home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / obero / Interfaces3_6.lha / Interfaces / Intuition.mod < prev    next >
Encoding:
Text File  |  1995-01-13  |  174.8 KB  |  4,120 lines

  1. (*
  2. (*
  3. **  Amiga Oberon Interface Module:
  4. **  $VER: Intuition.mod 40.15 (12.1.95) Oberon 3.6
  5. **
  6. **   © 1993 by Fridtjof Siebert
  7. **   updated for V39, V40 by hartmut Goebel
  8. *)
  9. *)
  10.  
  11. MODULE Intuition;
  12.  
  13. IMPORT
  14.   e  * := Exec,
  15.   g  * := Graphics,
  16.   ie * := InputEvent,
  17.   t  * := Timer,
  18.   u  * := Utility,
  19.   km * := KeyMap,
  20.   y := SYSTEM;
  21.  
  22. TYPE
  23.   MenuPtr          * = UNTRACED POINTER TO Menu;
  24.   MenuItemPtr      * = UNTRACED POINTER TO MenuItem;
  25.   RequesterPtr     * = UNTRACED POINTER TO Requester;
  26.   GadgetPtr        * = UNTRACED POINTER TO Gadget;
  27.   GadSpecialInfoPtr* = UNTRACED POINTER TO GadSpecialInfo;
  28.   BoolInfoPtr      * = UNTRACED POINTER TO BoolInfo;
  29.   PropInfoPtr      * = UNTRACED POINTER TO PropInfo;
  30.   StringInfoPtr    * = UNTRACED POINTER TO StringInfo;
  31.   IntuiTextPtr     * = UNTRACED POINTER TO IntuiText;
  32.   BorderPtr        * = UNTRACED POINTER TO Border;
  33.   ImagePtr         * = UNTRACED POINTER TO Image;
  34.   IntuiMessagePtr  * = UNTRACED POINTER TO IntuiMessage;
  35.   IBoxPtr          * = UNTRACED POINTER TO IBox;
  36.   WindowPtr        * = UNTRACED POINTER TO Window;
  37.   NewWindowPtr     * = UNTRACED POINTER TO NewWindow;
  38.   ExtNewWindowPtr  * = UNTRACED POINTER TO ExtNewWindow;
  39.   RememberPtr      * = UNTRACED POINTER TO Remember;
  40.   ColorSpecPtr     * = UNTRACED POINTER TO ColorSpec;
  41.   EasyStructPtr    * = UNTRACED POINTER TO EasyStruct;
  42.   GadgetInfoPtr    * = UNTRACED POINTER TO GadgetInfo;
  43.   PGXPtr           * = UNTRACED POINTER TO PGX;
  44.   MsgPtr           * = UNTRACED POINTER TO Msg;
  45.   OpSetPtr         * = UNTRACED POINTER TO OpSet;
  46.   OpUpdatePtr      * = UNTRACED POINTER TO OpUpdate;
  47.   OpGetPtr         * = UNTRACED POINTER TO OpGet;
  48.   OpAddTailPtr     * = UNTRACED POINTER TO OpAddTail;
  49.   OpMemberPtr      * = UNTRACED POINTER TO OpMember;
  50.   IClassPtr        * = UNTRACED POINTER TO IClass;
  51.   ClassPtr         * = IClassPtr;
  52.   ObjectPtr        * = UNTRACED POINTER TO Object;
  53.   HitTestPtr       * = UNTRACED POINTER TO HitTest;
  54.   RenderPtr        * = UNTRACED POINTER TO Render;
  55.   InputPtr         * = UNTRACED POINTER TO Input;
  56.   GoInactivePtr    * = UNTRACED POINTER TO GoInactive;
  57.   FrameBoxPtr      * = UNTRACED POINTER TO FrameBox;
  58.   DrawPtr          * = UNTRACED POINTER TO Draw;
  59.   ErasePtr         * = UNTRACED POINTER TO Erase;
  60.   IMHitTestPtr     * = UNTRACED POINTER TO IMHitTest;
  61.   PreferencesPtr   * = UNTRACED POINTER TO Preferences;
  62.   DrawInfoPtr      * = UNTRACED POINTER TO DrawInfo;
  63.   ScreenPtr        * = UNTRACED POINTER TO Screen;
  64.   NewScreenPtr     * = UNTRACED POINTER TO NewScreen;
  65.   ExtNewScreenPtr  * = UNTRACED POINTER TO ExtNewScreen;
  66.   PubScreenNodePtr * = UNTRACED POINTER TO PubScreenNode;
  67.   StringExtendPtr  * = UNTRACED POINTER TO StringExtend;
  68.   SGWorkPtr        * = UNTRACED POINTER TO SGWork;
  69.   IntuitionBasePtr * = UNTRACED POINTER TO IntuitionBase;
  70.   GadgetDummyPtr   * = UNTRACED POINTER TO GadgetDummy;
  71.   ExtGadgetPtr     * = UNTRACED POINTER TO ExtGadget;
  72.   ExtIntuiMessagePtr * = UNTRACED POINTER TO ExtIntuiMessage;
  73.   TabletDataPtr    * = UNTRACED POINTER TO TabletData;
  74.   TabletHookDataPtr * = UNTRACED POINTER TO TabletHookData;
  75.   LayoutPtr        * = UNTRACED POINTER TO Layout;
  76.   ScreenBufferPtr  * = UNTRACED POINTER TO ScreenBuffer;
  77.   DRIPenArrayPtr   * = UNTRACED POINTER TO DRIPenArray;
  78.  
  79. CONST
  80.   intuitionName * = "intuition.library";
  81.  
  82. TYPE
  83. (* ======================================================================== *)
  84. (* === Menu =============================================================== *)
  85. (* ======================================================================== *)
  86.   Menu * = STRUCT
  87.     nextMenu * : MenuPtr;             (* same level *)
  88.     leftEdge * , topEdge * : INTEGER; (* position of the select box *)
  89.     width * , height * : INTEGER;     (* dimensions of the select box *)
  90.     flags * : SET;                    (* see flag definitions below *)
  91.     menuName * : e.LSTRPTR;           (* text for this Menu Header *)
  92.     firstItem * : MenuItemPtr;        (* pointer to first in chain *)
  93.  
  94.     (* these mysteriously-named variables are for internal use only *)
  95.     jazzX * , jazzY * , beatX * , beatY * : INTEGER;
  96.   END;
  97.  
  98. CONST
  99.  
  100. (* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION *)
  101.   menuEnabled * = 0;      (* whether or not this menu is enabled *)
  102.  
  103. (* FLAGS SET BY INTUITION *)
  104.   miDrawn * = 8;          (* this menu's items are currently drawn *)
  105.  
  106.  
  107. TYPE
  108. (* ======================================================================== *)
  109. (* === MenuItem =========================================================== *)
  110. (* ======================================================================== *)
  111.   MenuItem * = STRUCT
  112.     nextItem * : MenuItemPtr;            (* pointer to next in chained list *)
  113.     leftEdge * , topEdge * : INTEGER;    (* position of the select box *)
  114.     width * , height * : INTEGER;        (* dimensions of the select box *)
  115.     flags * : SET;                       (* see the defines below *)
  116.  
  117.     mutualExclude * : LONGSET;           (* set bits mean this item excludes that *)
  118.  
  119.     itemFill * : e.APTR;                 (* points to Image, IntuiText, or NULL *)
  120.  
  121.     (* when this item is pointed to by the cursor and the items highlight
  122.      *  mode HIGHIMAGE is selected, this alternate image will be displayed
  123.      *)
  124.     selectFill * : e.APTR;               (* points to Image, IntuiText, or NULL *)
  125.  
  126.     command * : CHAR;                    (* only if appliprog sets the COMMSEQ flag *)
  127.  
  128.     subItem * : MenuItemPtr;             (* if non-zero, points to MenuItem for submenu *)
  129.  
  130.     (* The NextSelect field represents the menu number of next selected
  131.      *  item (when user has drag-selected several items)
  132.      *)
  133.     nextSelect * : INTEGER;
  134.   END;
  135.  
  136. CONST
  137.  
  138. (* FLAGS SET BY THE APPLIPROG *)
  139.   checkIt         * = 0;  (* set to indicate checkmarkable item *)
  140.   itemText        * = 1;  (* set if textual, clear if graphical item *)
  141.   commSeq         * = 2;  (* set if there's an command sequence *)
  142.   menuToggle      * = 3;  (* set for toggling checks (else mut. exclude) *)
  143.   itemEnabled     * = 4;  (* set if this item is enabled *)
  144.  
  145. (* these are the SPECIAL HIGHLIGHT FLAG state meanings *)
  146.   highFlags       * = {6,7};               (* see definitions below for these bits *)
  147.   highImage       * = {};                  (* use the user's "select image" *)
  148.   highComp        * = 6;                   (* highlight by complementing the selectbox *)
  149.   highBox         * = 7;                   (* highlight by "boxing" the selectbox *)
  150.   highNone        * = {highBox,highComp};  (* don't highlight *)
  151.  
  152. (* FLAGS SET BY BOTH APPLIPROG AND INTUITION *)
  153.   checked         * = 8;  (* state of the checkmark *)
  154.  
  155. (* FLAGS SET BY INTUITION *)
  156.   isDrawn         * = 12; (* this item's subs are currently drawn *)
  157.   highItem        * = 13; (* this item is currently highlighted *)
  158.   menuToggled     * = 14; (* this item was already toggled *)
  159.  
  160.  
  161. TYPE
  162. (* ======================================================================== *)
  163. (* === Requester ========================================================== *)
  164. (* ======================================================================== *)
  165.   Requester * = STRUCT
  166.     olderRequest * : RequesterPtr;
  167.     leftEdge * , topEdge * : INTEGER;   (* dimensions of the entire box *)
  168.     width * , height * : INTEGER;       (* dimensions of the entire box *)
  169.     relLeft * , relTop * : INTEGER;     (* for Pointer relativity offsets *)
  170.  
  171.     reqGadget * : GadgetDummyPtr;       (* pointer to a list of Gadgets *)
  172.     reqBorder * : BorderPtr;            (* the box's border *)
  173.     reqText   * : IntuiTextPtr;         (* the box's text *)
  174.     flags * : SET;                      (* see definitions below *)
  175.  
  176.     (* pen number for back-plane fill before draws *)
  177.     backFill * : SHORTINT;
  178.     (* Layer in place of clip rect      *)
  179.     reqLayer * : g.LayerPtr;
  180.  
  181.     reqPad1 * : ARRAY 32 OF e.BYTE;
  182.  
  183.     (* If the BitMap plane pointers are non-zero, this tells the system
  184.      * that the image comes pre-drawn (if the appliprog wants to define
  185.      * its own box, in any shape or size it wants!);  this is OK by
  186.      * Intuition as long as there's a good correspondence between
  187.      * the image and the specified Gadgets
  188.      *)
  189.     imageBMap * : g.BitMapPtr;          (* points to the BitMap of PREDRAWN imagery *)
  190.     rWindow * : WindowPtr;              (* added.  points back to Window *)
  191.  
  192.     reqImage * : ImagePtr;              (* new for V36: drawn if USEREQIMAGE set *)
  193.  
  194.     reqPad2 * : ARRAY 32 OF e.BYTE;
  195.   END;
  196.  
  197.  
  198. CONST
  199.  
  200. (* FLAGS SET BY THE APPLIPROG *)
  201.   pointRel        * = 0;
  202.                           (* if POINTREL set, TopLeft is relative to pointer
  203.                            * for DMRequester, relative to window center
  204.                            * for Request().
  205.                            *)
  206.   preDrawn        * = 1;
  207.         (* set if Requester.ImageBMap points to predrawn Requester imagery *)
  208.   noisyReq        * = 2;
  209.         (* if you don't want requester to filter input     *)
  210.   simpleReq       * = 4;
  211.         (* to use SIMPLEREFRESH layer (recommended)     *)
  212.  
  213. (* New for V36          *)
  214.   useReqImage     * = 5;
  215.         (*  render linked list ReqImage after BackFill
  216.          * but before gadgets and text
  217.          *)
  218.   noReqBackFill   * = 6;
  219.         (* don't bother filling requester with Requester.BackFill pen   *)
  220.  
  221.  
  222. (* FLAGS SET BY INTUITION *)
  223.   reqOffWindow    * = 12; (* part of one of the Gadgets was offwindow *)
  224.   reqActive       * = 13; (* this requester is active *)
  225.   sysRequest      * = 14; (* this requester caused by system *)
  226.   deferRefresh    * = 15; (* this Requester stops a Refresh broadcast *)
  227.  
  228.  
  229. TYPE
  230. (* ======================================================================== *)
  231. (* === Gadget ============================================================= *)
  232. (* ======================================================================== *)
  233.  
  234.   GadgetDummy * = STRUCT END;    (* dummy base type for Gadget and ExtGadget *)
  235.   GadSpecialInfo * = STRUCT END; (* dummy base type of all SpecialInfos *)
  236.  
  237.   Gadget * = STRUCT (dummy *: GadgetDummy)
  238.     nextGadget * : GadgetDummyPtr;    (* next gadget in the list *)
  239.  
  240.     leftEdge * , topEdge * : INTEGER; (* "hit box" of gadget *)
  241.     width * , height * : INTEGER;     (* "hit box" of gadget *)
  242.  
  243.     flags * : SET;                    (* see below for list of defines *)
  244.  
  245.     activation * : SET;               (* see below for list of defines *)
  246.  
  247.     gadgetType * : INTEGER;           (* see below for defines *)
  248.  
  249.     (* appliprog can specify that the Gadget be rendered as either as Border
  250.      * or an Image.  This variable points to which (or equals NULL if there's
  251.      * nothing to be rendered about this Gadget)
  252.      *)
  253.     gadgetRender * : e.APTR;
  254.  
  255.     (* appliprog can specify "highlighted" imagery rather than algorithmic
  256.      * this can point to either Border or Image data
  257.      *)
  258.     selectRender * : e.APTR;
  259.  
  260.     gadgetText * : IntuiTextPtr;      (* text for this gadget *)
  261.  
  262.     (* MutualExclude, never implemented, is now declared obsolete.
  263.      * There are published examples of implementing a more general
  264.      * and practical exclusion in your applications.
  265.      *
  266.      * Starting with V36, this field is used to point to a hook
  267.      * for a custom gadget.
  268.      *
  269.      * Programs using this field for their own processing will
  270.      * continue to work, as long as they don't try the
  271.      * trick with custom gadgets.
  272.      *)
  273.     mutualExclude * : LONGSET;        (* obsolete *)
  274.  
  275.     (* pointer to a structure of special data required by Proportional,
  276.      * String and Integer Gadgets
  277.      *)
  278.     specialInfo * : GadSpecialInfoPtr;
  279.  
  280.     gadgetID * : INTEGER;             (* user-definable ID field *)
  281.     userData * : e.APTR;              (* ptr to general purpose User data (ignored by In) *)
  282.   END;
  283.  
  284.  
  285. TYPE
  286.   ExtGadget * = STRUCT (dummy *: GadgetDummy)
  287.     nextGadget * : GadgetDummyPtr;     (* Matches struct Gadget *)
  288.     leftEdge * , topEdge * : INTEGER;  (* Matches struct Gadget *)
  289.     width * , height * : INTEGER;      (* Matches struct Gadget *)
  290.     flags * : SET;                     (* Matches struct Gadget *)
  291.     activation * : SET;                (* Matches struct Gadget *)
  292.     gadgetType * : INTEGER;            (* Matches struct Gadget *)
  293.     gadgetRender * : e.APTR;           (* Matches struct Gadget *)
  294.     selectRender * : e.APTR;           (* Matches struct Gadget *)
  295.     gadgetText * : IntuiTextPtr;       (* Matches struct Gadget *)
  296.     mutualExclude * : LONGSET;         (* Matches struct Gadget *)
  297.     specialInfo * : GadSpecialInfoPtr; (* Matches struct Gadget *)
  298.     gadgetID * : INTEGER;              (* Matches struct Gadget *)
  299.     userData * : e.APTR;               (* Matches struct Gadget *)
  300.  
  301.     (* These fields only exist under V39 and only if GFLG_EXTENDED is set *)
  302.     moreFlags      * : LONGSET;        (* see GMORE_ flags below *)
  303.     boundsLeftEdge * : INTEGER;        (* Bounding extent for gadget, valid   *)
  304.     boundsTopEdge  * : INTEGER;        (* only if GMORE_BOUNDS is set.  The   *)
  305.     boundsWidth    * : INTEGER;        (* GFLG_RELxxx flags affect these      *)
  306.     boundsHeight   * : INTEGER;        (* coordinates as well.        *)
  307.   END;
  308.  
  309. CONST
  310. (* --- Gadget.Flags values      --- *)
  311. (* combinations in these bits describe the highlight technique to be used *)
  312.   gadgHighBits * = {0,1};
  313.   gadgHComp    * = {};    (* Complement the select box *)
  314.   gadgHBox     * = 0;     (* Draw a box around the image *)
  315.   gadgHImage   * = 1;     (* Blast in this alternate image *)
  316.   gadgHNone    * = {0,1}; (* don't highlight *)
  317.  
  318.   gadgImage    * = 2;  (* set if GadgetRender and SelectRender
  319.                         * point to an Image structure, clear
  320.                         * if they point to Border structures
  321.                         *)
  322.  
  323. (*  combinations in these next two bits specify to which corner the gadget's
  324.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  325.  *  these are "normal" coordinates (everything is relative to something in
  326.  *  this universe).
  327.  *
  328.  * Gadget positions and dimensions are relative to the window or
  329.  * requester which contains the gadget
  330.  *)
  331.   gRelBottom    * = 3;  (* vert. pos. is relative to bottom edge *)
  332.   gRelRight     * = 4;  (* horiz. pos. is relative to right edge *)
  333.   gRelWidth     * = 5;  (* width is relative to req/window    *)
  334.   gRelHeight    * = 6;  (* height is relative to req/window   *)
  335.  
  336. (* New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  337.  * make gadgets whose position and size depend in an arbitrary way
  338.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  339.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  340.  * such as when the window opens or the window's size changes.
  341.  *)
  342.   gRelSpecial * =  14;  (* custom gadget has special relativity.
  343.                          * Gadget box values are absolutes, but
  344.                          * can be changed via the GM_LAYOUT method.
  345.                          *)
  346.   selected     * = 7;  (* you may initialize and look at this        *)
  347.  
  348. (* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  349.  * according to your calls to On/OffGadget().  It specifies whether or not
  350.  * this Gadget is currently disabled from being selected
  351.  *)
  352.   gadgDisabled * = 8;
  353.  
  354. (* These flags specify the type of text field that Gadget.GadgetText
  355.  * points to.  In all normal (pre-V36) gadgets which you initialize
  356.  * this field should always be zero.  Some types of gadget objects
  357.  * created from classes will use these fields to keep track of
  358.  * types of labels/contents that different from IntuiText, but are
  359.  * stashed in GadgetText.
  360.  *)
  361.  
  362.   labelMask    * = {12,13};
  363.   labelIText   * = {}; (* GadgetText points to IntuiText     *)
  364.   labelString  * = 12; (* GadgetText points to STRING        *)
  365.   labelImage   * = 13; (* GadgetText points to Image (object)        *)
  366. (* New for V37: GFLG_TABCYCLE *)
  367.   tabCycle     * =  9; (* (string or custom) gadget participates in
  368.                         * cycling activation with Tab or Shift-Tab
  369.                         *)
  370. (* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  371.  * ignore the value we had chosen for the Gadget->Activation flag
  372.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  373.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  374.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  375.  * (Note that the two flags are not numerically equal)
  376.  *)
  377.   stringExtend * = 10; (* this String Gadget has StringExtend        *)
  378.  
  379. (* New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  380.  * the custom image of this gadget knows how to do disabled rendering
  381.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  382.  * Intuition uses this to defer the ghosting to the image-class,
  383.  * instead of doing it itself (the old compatible way).
  384.  * Do not set this flag yourself - Intuition will do it for you.
  385.  *)
  386.  
  387.   gImagedisable * = 11;  (* Gadget's image knows how to do disabled
  388.                           * rendering
  389.                           *)
  390.  
  391. (* New for V39:  If set, this bit means that the Gadget is actually
  392.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  393.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  394.  * fields of a gadget if this flag is not set.
  395.  *)
  396.   gExtended     * =  15;  (* Gadget is extended *)
  397.  
  398.  
  399. (* ---  Gadget.Activation flag values   --- *)
  400. (* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  401.  * the gadget when the select button was released.  Will cause
  402.  * an IDCMP_GADGETUP message to be sent if so.
  403.  *)
  404.   relVerify    * = 0;
  405.  
  406. (* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  407.  *  was activated when it was activated.  This flag works in conjunction with
  408.  *  the GACT_RELVERIFY flag
  409.  *)
  410.   gadgImmediate* = 1;
  411.  
  412. (* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  413.  * when selected, causes the Requester to be ended.  Requesters
  414.  * that are ended are erased and unlinked from the system.
  415.  *)
  416.   endGadget    * = 2;
  417.  
  418. (* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  419.  * reports on mouse movements while this gadget is active.
  420.  * You probably want to set the GACT_IMMEDIATE flag when using
  421.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  422.  * learning why Intuition is suddenly sending you a stream of mouse
  423.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  424.  * least one Mouse Position event.
  425.  *)
  426.   followMouse  * = 3;
  427.  
  428. (* if any of the BORDER flags are set in a Gadget that's included in the
  429.  * Gadget list when a Window is opened, the corresponding Border will
  430.  * be adjusted to make room for the Gadget
  431.  *)
  432.   rightBorder  * = 4;
  433.   leftBorder   * = 5;
  434.   topBorder    * = 6;
  435.   bottomBorder * = 7;
  436.   borderSniff  * = 15;  (* neither set nor rely on this bit   *)
  437.  
  438.   toggleSelect * = 8;   (* this bit for toggle-select mode *)
  439.   boolExtend   * = 13;  (* this Boolean Gadget has a BoolInfo *)
  440.  
  441. (* should properly be in StringInfo, but aren't *)
  442.   stringLeft   * = {};  (* NOTE WELL: that this has value zero        *)
  443.   stringCenter * = 9;
  444.   stringRight  * = 10;
  445.   longint      * = 11;  (* this String Gadget is for Long Ints        *)
  446.   altKeyMap    * = 12;  (* this String has an alternate keymap        *)
  447.   actStringExtend * = 13;  (* this String Gadget has StringExtend        *)
  448.                         (* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  449.                          * ARE RUNNING ON LESS THAN V36!  SEE
  450.                          * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  451.                          *)
  452.  
  453.  
  454.   activeGadget * = 14; (* this gadget is "active".  This flag
  455.                         * is maintained by Intuition, and you
  456.                         * cannot count on its value persisting
  457.                         * while you do something on your program's
  458.                         * task.  It can only be trusted by
  459.                         * people implementing custom gadgets
  460.                         *)
  461.  
  462. (* note 0x8000 is used above (GACT_BORDERSNIFF);
  463.  * all Activation flags defined *)
  464.  
  465. (* --- GADGET TYPES ------------------------------------------------------- *)
  466. (* These are the Gadget Type definitions for the variable GadgetType
  467.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  468.  * first comes the mask for Gadget flags reserved for Gadget typing
  469.  *)
  470.   gadgetType * = 0FC00U;  (* all Gadget Global Type flags (padded) *)
  471.   scrGadget  * = 04000U;  (* 1 = ScreenGadget, 0 = WindowGadget *)
  472.   gzzGadget  * = 02000U;  (* 1 = for WFLG_GIMMEZEROZERO borders *)
  473.   reqGadget  * = 01000U;  (* 1 = this is a Requester Gadget *)
  474.  
  475. (* GTYP_SYSGADGET means that Intuition ALLOCATED the gadget.
  476.  * GTYP_SYSTYPEMASK is the mask you can apply to tell what type of
  477.  * system-gadget it is.  The possible types follow.
  478.  *)
  479.  
  480.   sysGadget   * = 08000U;
  481.   sysTypeMask * = 000F0U;
  482.  
  483. (* These definitions describe system gadgets in V36 and higher: *)
  484.   sizing     * = 00010U;   (* Window sizing gadget *)
  485.   wDragging  * = 00020U;   (* Window drag bar      *)
  486.   sDragging  * = 00030U;   (* Screen drag bar      *)
  487.   wDepth     * = 00040U;   (* Window depth gadget  *)
  488.   sDepth     * = 00050U;   (* Screen depth gadget  *)
  489.   wZoom      * = 00060U;   (* Window zoom gadget   *)
  490.   sUnused    * = 00070U;   (* Unused screen gadget *)
  491.   close      * = 00080U;   (* Window close gadget  *)
  492.  
  493. (* These definitions describe system gadgets prior to V36: *)
  494.   wUpFront   * = wDepth;   (* Window to-front gadget *)
  495.   sUpFront   * = sDepth;   (* Screen to-front gadget *)
  496.   wDownBack  * = wZoom;    (* Window to-back gadget  *)
  497.   sDownBack  * = sUnused;  (* Screen to-back gadget  *)
  498.  
  499.   gTypeMask    * = 00007U;
  500.  
  501.   boolGadget   * = 00001U;
  502.   gadget0002   * = 00002U;
  503.   propGadget   * = 00003U;
  504.   strGadget    * = 00004U;
  505.   customGadget * = 00005U;
  506.  
  507. (* This bit in GadgetType is reserved for undocumented internal use
  508.  * by the Gadget Toolkit, and cannot be used nor relied on by
  509.  * applications:        0x0100
  510.  *)
  511.  
  512. (* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  513.  * actually ExtGadgets, which have more flags.        The GMORE_xxx
  514.  * identifiers describe those flags.  For GMORE_SCROLLRASTER, see
  515.  * important information in the ScrollWindowRaster() autodoc.
  516.  * NB: GMORE_SCROLLRASTER must be set before the gadget is
  517.  * added to a window.
  518.  *)
  519.   gmoreBounds       * =  0; (* ExtGadget has valid Bounds *)
  520.   gmoreGadgetHelp   * =  1; (* This gadget responds to gadget help *)
  521.   gmoreScrollRaster * =  2; (* This (custom) gadget uses ScrollRaster *)
  522.  
  523.  
  524. TYPE
  525. (* ======================================================================== *)
  526. (* === BoolInfo =========================================================== *)
  527. (* ======================================================================== *)
  528. (* This is the special data needed by an Extended Boolean Gadget
  529.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  530.  *)
  531.   BoolInfo * = STRUCT (dummy *: GadSpecialInfo)
  532.     flags * : SET;        (* defined below *)
  533.     mask * : e.APTR;      (* bit mask for highlighting and selecting
  534.                            * mask must follow the same rules as an Image
  535.                            * plane.  Its width and height are determined
  536.                            * by the width and height of the gadget's
  537.                            * select box. (i.e. Gadget.Width and .Height).
  538.                            *)
  539.     reserved * : LONGINT; (* set to 0     *)
  540.   END;
  541.  
  542. CONST
  543.  
  544. (* set BoolInfo.Flags to this flag bit.
  545.  * in the future, additional bits might mean more stuff hanging
  546.  * off of BoolInfo.Reserved.
  547.  *)
  548.   boolMask * = 0;   (* extension is for masked gadget *)
  549.  
  550.  
  551. TYPE
  552. (* ======================================================================== *)
  553. (* === PropInfo =========================================================== *)
  554. (* ======================================================================== *)
  555. (* this is the special data required by the proportional Gadget
  556.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  557.  *)
  558.   PropInfo * = STRUCT (dummy *: GadSpecialInfo)
  559.     flags * : SET;        (* general purpose flag bits (see defines below) *)
  560.  
  561.     (* You initialize the Pot variables before the Gadget is added to
  562.      * the system.  Then you can look here for the current settings
  563.      * any time, even while User is playing with this Gadget.  To
  564.      * adjust these after the Gadget is added to the System, use
  565.      * ModifyProp();  The Pots are the actual proportional settings,
  566.      * where a value of zero means zero and a value of MAXPOT means
  567.      * that the Gadget is set to its maximum setting.
  568.      *)
  569.     horizPot * : INTEGER; (* 16-bit FixedPoint horizontal quantity percentage *)
  570.     vertPot * : INTEGER;  (* 16-bit FixedPoint vertical quantity percentage *)
  571.  
  572.     (* the 16-bit FixedPoint Body variables describe what percentage of
  573.      * the entire body of stuff referred to by this Gadget is actually
  574.      * shown at one time.  This is used with the AUTOKNOB routines,
  575.      * to adjust the size of the AUTOKNOB according to how much of
  576.      * the data can be seen.  This is also used to decide how far
  577.      * to advance the Pots when User hits the Container of the Gadget.
  578.      * For instance, if you were controlling the display of a 5-line
  579.      * Window of text with this Gadget, and there was a total of 15
  580.      * lines that could be displayed, you would set the VertBody value to
  581.      *     (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  582.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  583.      * if User hits the Cotainer outside of the knob, the pot would
  584.      * advance 1/3 (plus or minus) If there's no body to show, or
  585.      * the total amount of displayable info is less than the display area,
  586.      * set the Body variables to the MAX.  To adjust these after the
  587.      * Gadget is added to the System, use ModifyProp();
  588.      *)
  589.     horizBody * : INTEGER;           (* horizontal Body *)
  590.     vertBody * : INTEGER;            (* vertical Body *)
  591.  
  592.     (* these are the variables that Intuition sets and maintains *)
  593.     cWidth * : INTEGER;      (* Container width (with any relativity absoluted) *)
  594.     cHeight * : INTEGER;     (* Container height (with any relativity absoluted) *)
  595.     hPotRes * , vPotRes * : INTEGER; (* pot increments *)
  596.     leftBorder * : INTEGER;          (* Container borders *)
  597.     topBorder * : INTEGER;           (* Container borders *)
  598.   END;
  599.  
  600. CONST
  601.  
  602. (* --- FLAG BITS ---------------------------------------------------------- *)
  603.   autoKnob        * = 0;    (* this flag sez:  gimme that old auto-knob *)
  604. (* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  605.  * you are currently limited to using a single Image of your own
  606.  * design: Intuition won't handle a linked list of images as
  607.  * a proportional gadget knob.
  608.  *)
  609.  
  610.   freeHoriz       * = 1;  (* if set, the knob can move horizontally *)
  611.   freeVert        * = 2;  (* if set, the knob can move vertically *)
  612.   propBorderless  * = 3;  (* if set, no border will be rendered *)
  613.   knobHit         * = 8;  (* set when this Knob is hit *)
  614.   propNewLook     * = 4;  (* set this if you want to get the new
  615.                            * V36 look
  616.                            *)
  617.  
  618.   knobHmin   * = 6;  (* minimum horizontal size of the Knob *)
  619.   knobVmin   * = 4;  (* minimum vertical size of the Knob *)
  620.   maxBody    * = 0FFFFU;  (* maximum body value *)
  621.   maxPot     * = 0FFFFU;  (* maximum pot value *)
  622.  
  623.  
  624. TYPE
  625. (* ======================================================================== *)
  626. (* === StringInfo ========================================================= *)
  627. (* ======================================================================== *)
  628. (* this is the special data required by the string Gadget
  629.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  630.  *)
  631.   StringInfo * = STRUCT (dummy *: GadSpecialInfo)
  632.     (* you initialize these variables, and then Intuition maintains them *)
  633.     buffer * : e.LSTRPTR;     (* the buffer containing the start and final string *)
  634.     undoBuffer * : e.LSTRPTR; (* optional buffer for undoing current entry *)
  635.     bufferPos * : INTEGER;    (* character position in Buffer *)
  636.     maxChars * : INTEGER;     (* max number of chars in Buffer (including NULL) *)
  637.     dispPos * : INTEGER;      (* Buffer position of first displayed character *)
  638.  
  639.     (* Intuition initializes and maintains these variables for you *)
  640.     undoPos * : INTEGER;      (* character position in the undo buffer *)
  641.     numChars * : INTEGER;     (* number of characters currently in Buffer *)
  642.     dispCount * : INTEGER;    (* number of whole characters visible in Container *)
  643.     cLeft * , cTop * : INTEGER;  (* topleft offset of the container *)
  644.  
  645.     (* This unused field is changed to allow extended specification
  646.      * of string gadget parameters.  It is ignored unless the flag
  647.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  648.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  649.      * (See GFLG_STRINGEXTEND for an important note)
  650.      *)
  651.     (* layerPtr * : LayerPtr;  --- obsolete --- *)
  652.     extension * : StringExtendPtr;
  653.  
  654.     (* you can initialize this variable before the gadget is submitted to
  655.      * Intuition, and then examine it later to discover what integer
  656.      * the user has entered (if the user never plays with the gadget,
  657.      * the value will be unchanged from your initial setting)
  658.      *)
  659.     longInt * : LONGINT;
  660.  
  661.     (* If you want this Gadget to use your own Console keymapping, you
  662.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  663.      * and then set this variable to point to your keymap.  If you don't
  664.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  665.      *)
  666.     altKeyMap * : km.KeyMapPtr;
  667.   END;
  668.  
  669.  
  670. (* ======================================================================== *)
  671. (* === IntuiText ========================================================== *)
  672. (* ======================================================================== *)
  673. (* IntuiText is a series of strings that start with a location
  674.  *  (always relative to the upper-left corner of something) and then the
  675.  *  text of the string.  The text is null-terminated.
  676.  *)
  677.   IntuiText * = STRUCT
  678.     frontPen * , backPen * : SHORTINT; (* the pen numbers for the rendering *)
  679.     drawMode * : SHORTSET;             (* the mode for rendering the text *)
  680.     leftEdge * : INTEGER;              (* relative start location for the text *)
  681.     topEdge * : INTEGER;               (* relative start location for the text *)
  682.     iTextFont * : g.TextAttrPtr;       (* if NULL, you accept the default *)
  683.     iText * : e.LSTRPTR;               (* pointer to null-terminated text *)
  684.     nextText * : IntuiTextPtr;         (* pointer to another IntuiText to render *)
  685.   END;
  686.  
  687.  
  688. (* ======================================================================== *)
  689. (* === Border ============================================================= *)
  690. (* ======================================================================== *)
  691. (* Data type Border, used for drawing a series of lines which is intended for
  692.  *  use as a border drawing, but which may, in fact, be used to render any
  693.  *  arbitrary vector shape.
  694.  *  The routine DrawBorder sets up the RastPort with the appropriate
  695.  *  variables, then does a Move to the first coordinate, then does Draws
  696.  *  to the subsequent coordinates.
  697.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  698.  *  on NextBorder
  699.  *)
  700.   Border * = STRUCT
  701.     leftEdge * , topEdge * : INTEGER;  (* initial offsets from the origin *)
  702.     frontPen * , backPen * : SHORTINT; (* pens numbers for rendering *)
  703.     drawMode * : SHORTSET;             (* mode for rendering *)
  704.     count * : SHORTINT;                (* number of XY pairs *)
  705.     xy * : e.APTR;                     (* vector coordinate pairs rel to LeftTop*)
  706.     nextBorder * : BorderPtr;          (* pointer to any other Border too *)
  707.   END;
  708.  
  709.  
  710. (* ======================================================================== *)
  711. (* === Image ============================================================== *)
  712. (* ======================================================================== *)
  713. (* This is a brief image structure for very simple transfers of
  714.  * image data to a RastPort
  715.  *)
  716.   Image * = STRUCT
  717.     leftEdge * : INTEGER;             (* starting offset relative to some origin *)
  718.     topEdge * : INTEGER;              (* starting offsets relative to some origin *)
  719.     width * : INTEGER;                (* pixel size (though data is word-aligned) *)
  720.     height * : INTEGER;
  721.     depth * : INTEGER;                (* >= 0, for images you create          *)
  722.     imageData * : e.APTR;             (* pointer to the actual word-aligned bits *)
  723.  
  724.     (* the PlanePick and PlaneOnOff variables work much the same way as the
  725.      * equivalent GELS Bob variables.  It's a space-saving
  726.      * mechanism for image data.  Rather than defining the image data
  727.      * for every plane of the RastPort, you need define data only
  728.      * for the planes that are not entirely zero or one.  As you
  729.      * define your Imagery, you will often find that most of the planes
  730.      * ARE just as color selectors.  For instance, if you're designing
  731.      * a two-color Gadget to use colors one and three, and the Gadget
  732.      * will reside in a five-plane display, bit plane zero of your
  733.      * imagery would be all ones, bit plane one would have data that
  734.      * describes the imagery, and bit planes two through four would be
  735.      * all zeroes.  Using these flags avoids wasting all
  736.      * that memory in this way:  first, you specify which planes you
  737.      * want your data to appear in using the PlanePick variable.  For
  738.      * each bit set in the variable, the next "plane" of your image
  739.      * data is blitted to the display.  For each bit clear in this
  740.      * variable, the corresponding bit in PlaneOnOff is examined.
  741.      * If that bit is clear, a "plane" of zeroes will be used.
  742.      * If the bit is set, ones will go out instead.  So, for our example:
  743.      *   Gadget.PlanePick = 0x02;
  744.      *   Gadget.PlaneOnOff = 0x01;
  745.      * Note that this also allows for generic Gadgets, like the
  746.      * System Gadgets, which will work in any number of bit planes.
  747.      * Note also that if you want an Image that is only a filled
  748.      * rectangle, you can get this by setting PlanePick to zero
  749.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  750.      * color of the rectangle.
  751.      *
  752.      * NOTE:  Intuition relies on PlanePick to know how many planes
  753.      * of data are found in ImageData.  There should be no more
  754.      * '1'-bits in PlanePick than there are planes in ImageData.
  755.      *)
  756.     planePick * , planeOnOff * : SHORTSET;
  757.  
  758.     (* if the NextImage variable is not NULL, Intuition presumes that
  759.      * it points to another Image structure with another Image to be
  760.      * rendered
  761.      *)
  762.     nextImage * : ImagePtr;
  763.   END;
  764.  
  765.  
  766. (* ======================================================================== *)
  767. (* === IntuiMessage ======================================================= *)
  768. (* ======================================================================== *)
  769.   IntuiMessage * = STRUCT (execMessage * : e.Message)
  770.  
  771.     (* the Class bits correspond directly with the IDCMP Flags, except for the
  772.      * special bit IDCMP_LONELYMESSAGE (defined below)
  773.      *)
  774.     class * : LONGSET;
  775.  
  776.     (* the Code field is for special values like MENU number *)
  777.     code * : INTEGER;
  778.  
  779.     (* the Qualifier field is a copy of the current InputEvent's Qualifier *)
  780.     qualifier * : SET;
  781.  
  782.     (* IAddress contains particular addresses for Intuition functions, like
  783.      * the pointer to the Gadget or the Screen
  784.      *)
  785.     iAddress * : e.APTR;
  786.  
  787.     (* when getting mouse movement reports, any event you get will have the
  788.      * the mouse coordinates in these variables.  the coordinates are relative
  789.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  790.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  791.      * be deltas from the last reported position.
  792.      *)
  793.     mouseX * , mouseY * : INTEGER;
  794.  
  795.     (* the time values are copies of the current system clock time.  Micros
  796.      * are in units of microseconds, Seconds in seconds.
  797.      *)
  798.     time * : t.TimeVal;
  799.  
  800.     (* the IDCMPWindow variable will always have the address of the Window of
  801.      * this IDCMP
  802.      *)
  803.     idcmpWindow * : WindowPtr;
  804.  
  805.     (* system-use variable *)
  806.     specialLink * : IntuiMessagePtr;
  807.   END;
  808.  
  809. (* New for V39:
  810.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  811.  * structure has an additional field for tablet data, which is usually
  812.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  813.  * events is installed in the system, windows with the WA_TabletMessages
  814.  * property set will find that eim_TabletData points to the TabletData
  815.  * structure.  Applications must first check that this field is non-NULL;
  816.  * it will be NULL for certain kinds of message, including mouse activity
  817.  * generated from other than the tablet (i.e. the keyboard equivalents
  818.  * or the mouse itself).
  819.  *
  820.  * NEVER EVER examine any extended fields when running under pre-V39!
  821.  *
  822.  * NOTE: This structure is subject to grow in the future.  Making
  823.  * assumptions about its size is A BAD IDEA.
  824.  *)
  825.  
  826.   ExtIntuiMessage * = STRUCT (intuiMessage *: IntuiMessage)
  827.     tabletData * : TabletDataPtr;
  828.   END;
  829.  
  830.  
  831. CONST
  832. (* --- IDCMP Classes ------------------------------------------------------ *)
  833. (* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  834.  * Manual for full details on the IDCMP classes.
  835.  *)
  836.   sizeVerify        * = 0;
  837.   newSize           * = 1;
  838.   refreshWindow     * = 2;
  839.   mouseButtons      * = 3;
  840.   mouseMove         * = 4;
  841.   gadgetDown        * = 5;
  842.   gadgetUp          * = 6;
  843.   reqSet            * = 7;
  844.   menuPick          * = 8;
  845.   closeWindow       * = 9;
  846.   rawKey            * = 10;
  847.   reqVerify         * = 11;
  848.   reqClear          * = 12;
  849.   menuVerify        * = 13;
  850.   newPrefs          * = 14;
  851.   diskInserted      * = 15;
  852.   diskRemoved       * = 16;
  853.   wbenchMessage       = 17;  (*  System use only         *)
  854.   activeWindow      * = 18;
  855.   inactiveWindow    * = 19;
  856.   deltaMove         * = 20;
  857.   vanillaKey        * = 21;
  858.   intuiTicks        * = 22;
  859. (* for notifications from "boopsi" gadgets       *)
  860.   idcmpUpdate       * = 23;  (* new for V36      *)
  861. (* for getting help key report during menu session  *)
  862.   menuHelp          * = 24;  (* new for V36      *)
  863. (* for notification of any move/size/zoom/change window *)
  864.   changeWindow      * = 25;  (* new for V36      *)
  865.   gadgetHelp        * = 26;  (* new for V39      *)
  866.  
  867. (* NOTEZ-BIEN:          31   is reserved for internal use   *)
  868.  
  869. (* the IDCMP Flags do not use this special bit, which is cleared when
  870.  * Intuition sends its special message to the Task, and set when Intuition
  871.  * gets its Message back from the Task.  Therefore, I can check here to
  872.  * find out fast whether or not this Message is available for me to send
  873.  *)
  874.   lonelyMessage     * = 31;
  875.  
  876.  
  877. (* --- IDCMP Codes -------------------------------------------------------- *)
  878. (* This group of codes is for the IDCMP_CHANGEWINDOW message *)
  879.   cwcodeMoveSize * =  0000H;  (* Window was moved and/or sized *)
  880.   cwcodeDepth    * =  0001H;  (* Window was depth-arranged (new for V39) *)
  881.  
  882. (* This group of codes is for the IDCMP_MENUVERIFY function *)
  883.   menuHot         * = 0001H;  (* Intui wants verification or MENUCANCEL   *)
  884.   menuCancel      * = 0002H;  (* HOT Reply of this cancels Menu operation *)
  885.   menuWaiting     * = 0003H;  (* Intuition simply wants a ReplyMsg() ASAP *)
  886.  
  887. (* These are internal tokens to represent state of verification attempts
  888.  * shown here as a clue.
  889.  *)
  890.   okOk            * = menuHot;    (* guy didn't care                      *)
  891.   okAbort         * = 0004H;      (* window rendered question moot        *)
  892.   okCancel        * = menuCancel; (* window sent cancel reply          *)
  893.  
  894. (* This group of codes is for the IDCMP_WBENCHMESSAGE messages *)
  895.   wbenchOpen      * = 0001H;
  896.   wbenchClose     * = 0002H;
  897.  
  898.  
  899. TYPE
  900.  
  901. (* A data structure common in V36 Intuition processing   *)
  902.   IBox * = STRUCT
  903.     left * : INTEGER;
  904.     top * : INTEGER;
  905.     width * : INTEGER;
  906.     height * : INTEGER;
  907.   END;
  908.  
  909.  
  910. (* ======================================================================== *)
  911. (* === Window ============================================================= *)
  912. (* ======================================================================== *)
  913.   Window * = STRUCT
  914.     nextWindow * : WindowPtr;           (* for the linked list in a screen *)
  915.  
  916.     leftEdge * , topEdge * : INTEGER;   (* screen dimensions of window *)
  917.     width * , height * : INTEGER;       (* screen dimensions of window *)
  918.  
  919.     mouseY * , mouseX * : INTEGER;      (* relative to upper-left of window *)
  920.  
  921.     minWidth * , minHeight * : INTEGER; (* minimum sizes *)
  922.     maxWidth * , maxHeight * : INTEGER; (* maximum sizes *)
  923.  
  924.     flags * : LONGSET;                  (* see below for defines *)
  925.  
  926.     menuStrip * : MenuPtr;              (* the strip of Menu headers *)
  927.  
  928.     title * : e.LSTRPTR;                (* the title text for this window *)
  929.  
  930.     firstRequest * : RequesterPtr;      (* all active Requesters *)
  931.  
  932.     dmRequest * : RequesterPtr;         (* double-click Requester *)
  933.  
  934.     reqCount * : INTEGER;               (* count of reqs blocking Window *)
  935.  
  936.     wScreen * : ScreenPtr;              (* this Window's Screen *)
  937.     rPort * : g.RastPortPtr;            (* this Window's very own RastPort *)
  938.  
  939.     (* the border variables describe the window border.  If you specify
  940.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  941.      * the ClipRect for this window will be upper-left of the BitMap (with
  942.      * correct offsets when in SuperBitMap mode; you MUST select
  943.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  944.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  945.      * ClipRect and associated Bitmaps), but you also must offset all your
  946.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  947.      * prevent writing over the system gadgets
  948.      *)
  949.     borderLeft * , borderTop * , borderRight * , borderBottom * : SHORTINT;
  950.     borderRPort * : g.RastPortPtr;
  951.  
  952.  
  953.     (* You supply a linked-list of Gadgets for your Window.
  954.      * This list DOES NOT include system gadgets.  You get the standard
  955.      * window system gadgets by setting flag-bits in the variable Flags (see
  956.      * the bit definitions below)
  957.      *)
  958.     firstGadget * : GadgetDummyPtr;
  959.  
  960.     (* these are for opening/closing the windows *)
  961.     parent * , descendant * : WindowPtr;
  962.  
  963.     (* sprite data information for your own Pointer
  964.      * set these AFTER you Open the Window by calling SetPointer()
  965.      *)
  966.     pointer * : e.APTR;    (* sprite data *)
  967.     ptrHeight * : SHORTINT;     (* sprite height (not including sprite padding) *)
  968.     ptrWidth * : SHORTINT;      (* sprite width (must be less than or equal to 16) *)
  969.     xOffset * , yOffset * : SHORTINT;      (* sprite offsets *)
  970.  
  971.     (* the IDCMP Flags and User's and Intuition's Message Ports *)
  972.     idcmpFlags * : LONGSET;   (* User-selected flags *)
  973.     userPort * : e.MsgPortPtr;
  974.     windowPort * : e.MsgPortPtr;
  975.     messageKey * : IntuiMessagePtr;
  976.  
  977.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  978.  
  979.     (* the CheckMark is a pointer to the imagery that will be used when
  980.      * rendering MenuItems of this Window that want to be checkmarked
  981.      * if this is equal to NULL, you'll get the default imagery
  982.      *)
  983.     checkMark * : ImagePtr;
  984.  
  985.     screenTitle * : e.LSTRPTR; (* if non-null, Screen title when Window is active *)
  986.  
  987.     (* These variables have the mouse coordinates relative to the
  988.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  989.      * MouseX and MouseY variables, which contain the mouse coordinates
  990.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  991.      * notwithstanding
  992.      *)
  993.     gzzMouseX * : INTEGER;
  994.     gzzMouseY * : INTEGER;
  995.     (* these variables contain the width and height of the inner-Window of
  996.      * WFLG_GIMMEZEROZERO Windows
  997.      *)
  998.     gzzWidth * : INTEGER;
  999.     gzzHeight * : INTEGER;
  1000.  
  1001.     extData * : e.APTR;
  1002.  
  1003.     userData * : e.APTR;     (* general-purpose pointer to User data extension *)
  1004.  
  1005.     (* 11/18/85: this pointer keeps a duplicate of what
  1006.      * Window.RPort->Layer is _supposed_ to be pointing at
  1007.      *)
  1008.     wLayer * : g.LayerPtr;
  1009.  
  1010.     (* NEW 1.2: need to keep track of the font that
  1011.      * OpenWindow opened, in case user SetFont's into RastPort
  1012.      *)
  1013.     iFont * : g.TextFontPtr;
  1014.  
  1015.     (* (V36) another flag word (the Flags field is used up).
  1016.      * At present, all flag values are system private.
  1017.      * Until further notice, you may not change nor use this field.
  1018.      *)
  1019.     moreFlags   : LONGSET;
  1020.  
  1021.     (**** Data beyond this point are Intuition Private.  DO NOT USE ****)
  1022.   END;
  1023.  
  1024. CONST
  1025. (* --- Flags requested at OpenWindow() time by the application --------- *)
  1026.   windowSizing   * = 0;      (* include sizing system-gadget? *)
  1027.   windowDrag     * = 1;      (* include dragging system-gadget? *)
  1028.   windowDepth    * = 2;      (* include depth arrangement gadget? *)
  1029.   windowClose    * = 3;      (* include close-box system-gadget? *)
  1030.  
  1031.   sizeBRight     * = 4;      (* size gadget uses right border *)
  1032.   sizeBBottom    * = 5;      (* size gadget uses bottom border *)
  1033.  
  1034. (* --- refresh modes ------------------------------------------------------ *)
  1035. (* combinations of the WFLG_REFRESHBITS select the refresh type *)
  1036.   refreshBits    * = LONGSET{6,7};
  1037.   smartRefresh   * = LONGSET{};
  1038.   simpleRefresh  * = 6;
  1039.   superBitMap    * = 7;
  1040.   otherRefresh   * = LONGSET{6,7};
  1041.  
  1042.   backDrop       * = 8;      (* this is a backdrop window *)
  1043.  
  1044.   reportMouse    * = 9;      (* to hear about every mouse move *)
  1045.  
  1046.   gimmeZeroZero  * = 10;     (* a GimmeZeroZero window       *)
  1047.  
  1048.   borderless     * = 11;     (* to get a Window sans border *)
  1049.  
  1050.   activate       * = 12;     (* when Window opens, it's Active *)
  1051.  
  1052. (* --- Other User Flags --------------------------------------------------- *)
  1053.   rmbTrap        * = 16;     (* Catch RMB events for your own *)
  1054.   noCareRefresh  * = 17;     (* not to be bothered with REFRESH *)
  1055.  
  1056. (* - V36 new Flags which the programmer may specify in NewWindow.Flags  *)
  1057.   nwExtended     * = 18;     (* extension data provided      *)
  1058.  
  1059. (* - V39 new Flags which the programmer may specify in NewWindow.Flags        *)
  1060.   newLookMenus   * = 21;     (* window has NewLook menus     *)
  1061.  
  1062.  
  1063. (* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! *)
  1064.   windowActive   * = 13;     (* this window is the active one *)
  1065.   inRequest      * = 14;     (* this window is in request mode *)
  1066.   menuState      * = 15;     (* Window is active with Menus on *)
  1067.   windowRefresh  * = 24;     (* Window is currently refreshing *)
  1068.   wbenchWindow   * = 25;     (* WorkBench tool ONLY Window *)
  1069.   windowTicked   * = 26;     (* only one timer tick at a time *)
  1070.  
  1071. (* V36 and higher flags to be set only by Intuition: *)
  1072.   visitor        * = 27;     (* visitor window               *)
  1073.   zoomed         * = 28;     (* identifies "zoom state"      *)
  1074.   hasZoom        * = 29;     (* windowhas a zoom gadget      *)
  1075.  
  1076. (* --- Other Window Values ---------------------------------------------- *)
  1077.   defaultMouseQueue * = 5;        (* no more mouse messages       *)
  1078.  
  1079. (* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- *)
  1080.  
  1081.  
  1082. TYPE
  1083. (* ======================================================================== *)
  1084. (* === NewWindow ========================================================== *)
  1085. (* ======================================================================== *)
  1086. (*
  1087.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  1088.  * structure below to make use of these fields
  1089.  *)
  1090.   NewWindow * = STRUCT
  1091.     leftEdge * , topEdge * : INTEGER;     (* screen dimensions of window *)
  1092.     width * , height * : INTEGER;         (* screen dimensions of window *)
  1093.  
  1094.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  1095.  
  1096.     idcmpFlags * : LONGSET;               (* User-selected IDCMP flags *)
  1097.  
  1098.     flags * : LONGSET;                    (* see Window struct for defines *)
  1099.  
  1100.     (* You supply a linked-list of Gadgets for your Window.
  1101.      *  This list DOES NOT include system Gadgets.  You get the standard
  1102.      *  system Window Gadgets by setting flag-bits in the variable Flags (see
  1103.      *  the bit definitions under the Window structure definition)
  1104.      *)
  1105.     firstGadget * : GadgetDummyPtr;
  1106.  
  1107.     (* the CheckMark is a pointer to the imagery that will be used when
  1108.      * rendering MenuItems of this Window that want to be checkmarked
  1109.      * if this is equal to NULL, you'll get the default imagery
  1110.      *)
  1111.     checkMark * : ImagePtr;
  1112.  
  1113.     title * : e.LSTRPTR;                  (* the title text for this window *)
  1114.  
  1115.     (* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1116.      * want this Window to open in it.  If so, you pass the address of the
  1117.      * Custom Screen structure in this variable.  Otherwise, this variable
  1118.      * is ignored and doesn't have to be initialized.
  1119.      *)
  1120.     screen * : ScreenPtr;
  1121.  
  1122.     (* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1123.      * structure in this variable.  If not, this variable is ignored and
  1124.      * doesn't have to be initialized
  1125.      *)
  1126.     bitMap * : g.BitMapPtr;
  1127.  
  1128.     (* the values describe the minimum and maximum sizes of your Windows.
  1129.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1130.      * which means that you want to let the User to change the size of
  1131.      * this Window.  You describe the minimum and maximum sizes that the
  1132.      * Window can grow by setting these variables.  You can initialize
  1133.      * any one these to zero, which will mean that you want to duplicate
  1134.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1135.      * set to the opening Width of the Window).
  1136.      * You can change these settings later using SetWindowLimits().
  1137.      * If you haven't asked for a SIZING Gadget, you don't have to
  1138.      * initialize any of these variables.
  1139.      *)
  1140.     minWidth * , minHeight * : INTEGER;       (* minimums *)
  1141.     maxWidth * , maxHeight * : INTEGER;       (* maximums *)
  1142.  
  1143.     (* the type variable describes the Screen in which you want this Window to
  1144.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1145.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1146.      * type definitions under the Screen structure.
  1147.      *)
  1148.     type * : SET;
  1149.   END;
  1150.  
  1151. (* The following structure is the future NewWindow.  Compatibility
  1152.  * issues require that the size of NewWindow not change.
  1153.  * Data in the common part (NewWindow) indicates the the extension
  1154.  * fields are being used.
  1155.  * NOTE WELL: This structure may be subject to future extension.
  1156.  * Writing code depending on its size is not allowed.
  1157.  *)
  1158.   ExtNewWindow * = STRUCT (nw * : NewWindow)
  1159.  
  1160.     (* ------------------------------------------------------- *
  1161.      * extensions for V36
  1162.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1163.      * this field is assumed to point to an array ( or chain of arrays)
  1164.      * of TagItem structures.  See also ExtNewScreen for another
  1165.      * use of TagItems to pass optional data.
  1166.      *
  1167.      * see below for tag values and the corresponding data.
  1168.      *)
  1169.     extension * : u.TagListPtr;
  1170.   END;
  1171.  
  1172. CONST
  1173. (*
  1174.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1175.  * They are values in a TagItem array passed as extension/replacement
  1176.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1177.  * work well with a NULL NewWindow pointer.
  1178.  *)
  1179.  
  1180.   waDummy            * = u.user + 99;  (* 0x80000063   *)
  1181.  
  1182. (* these tags simply override NewWindow parameters *)
  1183.   waLeft             * = waDummy + 001H;
  1184.   waTop              * = waDummy + 002H;
  1185.   waWidth            * = waDummy + 003H;
  1186.   waHeight           * = waDummy + 004H;
  1187.   waDetailPen        * = waDummy + 005H;
  1188.   waBlockPen         * = waDummy + 006H;
  1189.   waIDCMP            * = waDummy + 007H;
  1190.                   (* "bulk" initialization of NewWindow.Flags *)
  1191.   waFlags            * = waDummy + 008H;
  1192.   waGadgets          * = waDummy + 009H;
  1193.   waCheckmark        * = waDummy + 00AH;
  1194.   waTitle            * = waDummy + 00BH;
  1195.                   (* means you don't have to call SetWindowTitles
  1196.                    * after you open your window
  1197.                    *)
  1198.   waScreenTitle      * = waDummy + 00CH;
  1199.   waCustomScreen     * = waDummy + 00DH;
  1200.   waSuperBitMap      * = waDummy + 00EH;
  1201.                   (* also implies WFLG_SUPER_BITMAP property      *)
  1202.   waMinWidth         * = waDummy + 00FH;
  1203.   waMinHeight        * = waDummy + 010H;
  1204.   waMaxWidth         * = waDummy + 011H;
  1205.   waMaxHeight        * = waDummy + 012H;
  1206.  
  1207. (* The following are specifications for new features    *)
  1208.  
  1209.   waInnerWidth       * = waDummy + 013H;
  1210.   waInnerHeight      * = waDummy + 014H;
  1211.                   (* You can specify the dimensions of the interior
  1212.                    * region of your window, independent of what
  1213.                    * the border widths will be.  You probably want
  1214.                    * to also specify WA_AutoAdjust to allow
  1215.                    * Intuition to move your window or even
  1216.                    * shrink it so that it is completely on screen.
  1217.                    *)
  1218.  
  1219.   waPubScreenName    * = waDummy + 015H;
  1220.                   (* declares that you want the window to open as
  1221.                    * a visitor on the public screen whose name is
  1222.                    * pointed to by (UBYTE * )  ti_Data
  1223.                    *)
  1224.   waPubScreen        * = waDummy + 016H;
  1225.                   (* open as a visitor window on the public screen
  1226.                    * whose address is in (struct Screen * ) ti_Data.
  1227.                    * To ensure that this screen remains open, you
  1228.                    * should either be the screen's owner, have a
  1229.                    * window open on the screen, or use LockPubScreen().
  1230.                    *)
  1231.   waPubScreenFallBack* = waDummy + 017H;
  1232.                   (* A Boolean, specifies whether a visitor window
  1233.                    * should "fall back" to the default public screen
  1234.                    * (or Workbench) if the named public screen isn't
  1235.                    * available
  1236.                    *)
  1237.   waWindowName       * = waDummy + 018H;
  1238.                   (* not implemented      *)
  1239.   waColors           * = waDummy + 019H;
  1240.                   (* a ColorSpec array for colors to be set
  1241.                    * when this window is active.  This is not
  1242.                    * implemented, and may not be, since the default
  1243.                    * values to restore would be hard to track.
  1244.                    * We'd like to at least support per-window colors
  1245.                    * for the mouse pointer sprite.
  1246.                    *)
  1247.   waZoom             * = waDummy + 01AH;
  1248.                   (* ti_Data points to an array of four WORD's,
  1249.                    * the initial Left/Top/Width/Height values of
  1250.                    * the "alternate" zoom position/dimensions.
  1251.                    * It also specifies that you want a Zoom gadget
  1252.                    * for your window, whether or not you have a
  1253.                    * sizing gadget.
  1254.                    *)
  1255.   waMouseQueue       * = waDummy + 01BH;
  1256.                   (* ti_Data contains initial value for the mouse
  1257.                    * message backlog limit for this window.
  1258.                    *)
  1259.   waBackFill         * = waDummy + 01CH;
  1260.                   (* provides a "backfill hook" for your window's Layer.
  1261.                    * See layers.library/CreateUpfrontHookLayer().
  1262.                    *)
  1263.   waRptQueue         * = waDummy + 01DH;
  1264.                   (* initial value of repeat key backlog limit    *)
  1265.  
  1266.   (* These Boolean tag items are alternatives to the NewWindow.Flags
  1267.    * boolean flags with similar names.
  1268.    *)
  1269.   waSizeGadget       * = waDummy + 01EH;
  1270.   waDragBar          * = waDummy + 01FH;
  1271.   waDepthGadget      * = waDummy + 020H;
  1272.   waCloseGadget      * = waDummy + 021H;
  1273.   waBackdrop         * = waDummy + 022H;
  1274.   waReportMouse      * = waDummy + 023H;
  1275.   waNoCareRefresh    * = waDummy + 024H;
  1276.   waBorderless       * = waDummy + 025H;
  1277.   waActivate         * = waDummy + 026H;
  1278.   waRMBTrap          * = waDummy + 027H;
  1279.   waWBenchWindow     * = waDummy + 028H;      (* PIVATE!!! *)
  1280.   waSimpleRefresh    * = waDummy + 029H;
  1281.                   (* only specify if TRUE *)
  1282.   waSmartRefresh     * = waDummy + 02AH;
  1283.                   (* only specify if TRUE *)
  1284.   waSizeBRight       * = waDummy + 02BH;
  1285.   waSizeBBottom      * = waDummy + 02CH;
  1286.  
  1287.   (* New Boolean properties   *)
  1288.   waAutoAdjust       * = waDummy + 02DH;
  1289.                   (* shift or squeeze the window's position and
  1290.                    * dimensions to fit it on screen.
  1291.                    *)
  1292.  
  1293.   waGimmeZeroZero    * = waDummy + 02EH;
  1294.                   (* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO *)
  1295.  
  1296. (* New for V37: WA_MenuHelp (ignored by V36) *)
  1297.   waMenuHelp         * = waDummy + 02FH;
  1298.                   (* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1299.                    * will return IDCMP_MENUHELP message.
  1300.                    *)
  1301. (* New for V39:  (ignored by V37 and earlier) *)
  1302.   waNewLookMenus     * = waDummy + 030H;
  1303.                       (* Set to TRUE if you want NewLook menus *)
  1304.   waAmigaKey         * = waDummy + 031H;
  1305.                       (* Pointer to image for Amiga-key equiv in menus *)
  1306.   waNotifyDepth      * = waDummy + 032H;
  1307.                       (* Requests IDCMP_CHANGEWINDOW message when
  1308.                        * window is depth arranged
  1309.                        * (imsg->Code = CWCODE_DEPTH)
  1310.                        *)
  1311.  
  1312. (* WA_Dummy + 033 is obsolete *)
  1313.  
  1314.   waPointer          * = waDummy + 034H;
  1315.                       (* Allows you to specify a custom pointer
  1316.                        * for your window.  ti_Data points to a
  1317.                        * pointer object you obtained via
  1318.                        * "pointerclass". NULL signifies the
  1319.                        * default pointer.
  1320.                        * This tag may be passed to OpenWindowTags()
  1321.                        * or SetWindowPointer().
  1322.                        *)
  1323.  
  1324.   waBusyPointer      * = waDummy + 035H;
  1325.                       (* ti_Data is boolean.  Set to TRUE to
  1326.                        * request the standard busy pointer.
  1327.                        * This tag may be passed to OpenWindowTags()
  1328.                        * or SetWindowPointer().
  1329.                        *)
  1330.  
  1331.   waPointerDelay     * = waDummy + 036H;
  1332.                       (* ti_Data is boolean.  Set to TRUE to
  1333.                        * request that the changing of the
  1334.                        * pointer be slightly delayed.  The change
  1335.                        * will be called off if you call NewSetPointer()
  1336.                        * before the delay expires.  This allows
  1337.                        * you to post a busy-pointer even if you think
  1338.                        * the busy-time may be very short, without
  1339.                        * fear of a flashing pointer.
  1340.                        * This tag may be passed to OpenWindowTags()
  1341.                        * or SetWindowPointer().
  1342.                        *)
  1343.  
  1344.   waTabletMessages   * = waDummy + 037H;
  1345.                       (* ti_Data is a boolean.  Set to TRUE to
  1346.                        * request that tablet information be included
  1347.                        * in IntuiMessages sent to your window.
  1348.                        * Requires that something (i.e. a tablet driver)
  1349.                        * feed IESUBCLASS_NEWTABLET InputEvents into
  1350.                        * the system.  For a pointer to the TabletData,
  1351.                        * examine the ExtIntuiMessage->eim_TabletData
  1352.                        * field.  It is UNSAFE to check this field
  1353.                        * when running on pre-V39 systems.  It's always
  1354.                        * safe to check this field under V39 and up,
  1355.                        * though it may be NULL.
  1356.                        *)
  1357.  
  1358.   waHelpGroup        * = waDummy + 038H;
  1359.                       (* When the active window has gadget help enabled,
  1360.                        * other windows of the same HelpGroup number
  1361.                        * will also get GadgetHelp.  This allows GadgetHelp
  1362.                        * to work for multi-windowed applications.
  1363.                        * Use GetGroupID() to get an ID number.  Pass
  1364.                        * this number as ti_Data to all your windows.
  1365.                        * See also the HelpControl() function.
  1366.                        *)
  1367.  
  1368.   waHelpGroupWindow  * = waDummy + 039H;
  1369.                       (* When the active window has gadget help enabled,
  1370.                        * other windows of the same HelpGroup will also get
  1371.                        * GadgetHelp.  This allows GadgetHelp to work
  1372.                        * for multi-windowed applications.  As an alternative
  1373.                        * to WA_HelpGroup, you can pass a pointer to any
  1374.                        * other window of the same group to join its help
  1375.                        * group.  Defaults to NULL, which has no effect.
  1376.                        * See also the HelpControl() function.
  1377.                        *)
  1378.  
  1379.  
  1380. (* HelpControl() flags:
  1381.  *
  1382.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1383.  * windows.
  1384.  *)
  1385.  
  1386.   hcGadgetHelp * = 1; (* is this flag bit or flag mask? [hG] *)
  1387.  
  1388.  
  1389. TYPE
  1390. (* ======================================================================== *)
  1391. (* === Remember =========================================================== *)
  1392. (* ======================================================================== *)
  1393. (* this structure is used for remembering what memory has been allocated to
  1394.  * date by a given routine, so that a premature abort or systematic exit
  1395.  * can deallocate memory cleanly, easily, and completely
  1396.  *)
  1397.   Remember * = STRUCT
  1398.     nextRemember * : RememberPtr;
  1399.     rememberSize * : LONGINT;
  1400.     memory * : e.APTR;
  1401.   END;
  1402.  
  1403.  
  1404. (* === Color Spec ====================================================== *)
  1405. (* How to tell Intuition about RGB values for a color table entry.
  1406.  * NOTE:  The way the structure was defined, the color value was
  1407.  * right-justified within each UWORD.  This poses problems for
  1408.  * extensibility to more bits-per-gun.        The SA_Colors32 tag to
  1409.  * OpenScreenTags() provides an alternate way to specify colors
  1410.  * with greater precision.
  1411.  *)
  1412.   ColorSpec * = STRUCT
  1413.     colorIndex * : INTEGER;     (* -1 terminates an array of ColorSpec  *)
  1414.     red        * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1415.     green      * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1416.     blue       * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1417.   END;
  1418.  
  1419. (* === Easy Requester Specification ======================================= *)
  1420. (* see also autodocs for EasyRequest and BuildEasyRequest       *)
  1421. (* NOTE: This structure may grow in size in the future          *)
  1422.   EasyStruct * = STRUCT
  1423.     structSize * : LONGINT;     (* should be sizeof (struct EasyStruct )*)
  1424.     flags * : LONGSET;          (* should be 0 for now                  *)
  1425.     title * : e.LSTRPTR;        (* title of requester window            *)
  1426.     textFormat * : e.LSTRPTR;   (* 'printf' style formatting string     *)
  1427.     gadgetFormat * : e.LSTRPTR; (* 'printf' style formatting string   *)
  1428.   END;
  1429.  
  1430.  
  1431. CONST
  1432. (* ======================================================================== *)
  1433. (* === Miscellaneous ====================================================== *)
  1434. (* ======================================================================== *)
  1435.  
  1436. (* = MENU STUFF =========================================================== *)
  1437.   noMenu   * = 0001FU;
  1438.   noItem   * = 0003FU;
  1439.   noSub    * = 0001FU;
  1440.   menuNull * = 0FFFFU;
  1441.  
  1442.  
  1443. (* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1444.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1445.  * If COMMSEQ, likewise I'll use this generic stuff
  1446.  *)
  1447.   checkWidth     * = 19;
  1448.   commWidth      * = 27;
  1449.   lowCheckWidth  * = 13;
  1450.   lowCommWidth   * = 16;
  1451.  
  1452.  
  1453. (* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1454.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1455.  * of these patterns
  1456.  *)
  1457.   alertType     * = 80000000H;
  1458.   recoveryAlert * = 00000000H;      (* the system can recover from this *)
  1459.   deadendAlert  * = 80000000H;      (* no recovery possible, this is it *)
  1460.  
  1461.  
  1462. (* When you're defining IntuiText for the Positive and Negative Gadgets
  1463.  * created by a call to AutoRequest(), these defines will get you
  1464.  * reasonable-looking text.  The only field without a define is the IText
  1465.  * field; you decide what text goes with the Gadget
  1466.  *)
  1467.   autoFrontPen  * = 0;
  1468.   autoBackPen   * = 1;
  1469.   autoDrawMode  * = g.jam2;
  1470.   autoLeftEdge  * = 6;
  1471.   autoTopEdge   * = 3;
  1472.   autoITextFont * = NIL;
  1473.   autoNextText  * = NIL;
  1474.  
  1475.  
  1476. (* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- *)
  1477.   selectUp        * = ie.lButton + ie.upPrefix;
  1478.   selectDown      * = ie.lButton;
  1479.   menuUp          * = ie.rButton + ie.upPrefix;
  1480.   menuDown        * = ie.rButton;
  1481.   middleUp        * = ie.mButton + ie.upPrefix;
  1482.   middleDown      * = ie.mButton;
  1483.  
  1484.   altLeft         * = {ie.lAlt};
  1485.   altRight        * = {ie.rAlt};
  1486.   amigaLeft       * = {ie.lCommand};
  1487.   amigaRight      * = {ie.rCommand};
  1488.   amigaKeys       * = amigaLeft + amigaRight;
  1489.  
  1490.   cursorUp        * = 04CH;
  1491.   cursorLeft      * = 04FH;
  1492.   cursorRight     * = 04EH;
  1493.   cursorDown      * = 04DH;
  1494.   keyCodeQ        * = 010H;
  1495.   keyCodeZ        * = 031H;
  1496.   keyCodeX        * = 032H;
  1497.   keyCodeV        * = 034H;
  1498.   keyCodeB        * = 035H;
  1499.   keyCodeN        * = 036H;
  1500.   keyCodeM        * = 037H;
  1501.   keyCodeLess     * = 038H;
  1502.   keyCodeGreater  * = 039H;
  1503.  
  1504. (* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  1505.  * of the IECLASS_NEWPOINTERPOS event.        The ie_EventAddress of such
  1506.  * an event points to a TabletData structure (see below).
  1507.  *
  1508.  * The TabletData structure contains certain elements including a taglist.
  1509.  * The taglist can be used for special tablet parameters.  A tablet driver
  1510.  * should include only those tag-items the tablet supports.  An application
  1511.  * can listen for any tag-items that interest it.  Note: an application
  1512.  * must set the WA_TabletMessages attribute to TRUE to receive this
  1513.  * extended information in its IntuiMessages.
  1514.  *
  1515.  * The definitions given here MUST be followed.  Pay careful attention
  1516.  * to normalization and the interpretation of signs.
  1517.  *
  1518.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  1519.  * This unsigned value should typically be in the natural units of the
  1520.  * tablet.  You should also provide TABLETA_RangeZ.
  1521.  *
  1522.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  1523.  * Normally specified along with TABLETA_TabletZ, this allows the
  1524.  * application to scale the actual Z value across its range.
  1525.  *
  1526.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  1527.  * number should be normalized to fill a signed long integer.  Positive
  1528.  * values imply a clockwise rotation about the X-axis when viewing
  1529.  * from +X towards the origin.
  1530.  *
  1531.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  1532.  * number should be normalized to fill a signed long integer.  Positive
  1533.  * values imply a clockwise rotation about the Y-axis when viewing
  1534.  * from +Y towards the origin.
  1535.  *
  1536.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  1537.  * number should be normalized to fill a signed long integer.  Positive
  1538.  * values imply a clockwise rotation about the Z-axis when viewing
  1539.  * from +Z towards the origin.
  1540.  *
  1541.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  1542.  *    and TABLETA_AngleY attributes.  Tilting the stylus so the tip
  1543.  *    points towards increasing or decreasing X is actually a rotation
  1544.  *    around the Y-axis.  Thus, if the stylus tip points towards
  1545.  *    positive X, then that tilt is represented as a negative
  1546.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  1547.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  1548.  *
  1549.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  1550.  * should be normalized to fill a signed long integer.        Typical devices
  1551.  * won't generate negative pressure, but the possibility is not precluded.
  1552.  * The pressure threshold which is considered to cause a button-click is
  1553.  * expected to be set in a Preferences program supplied by the tablet
  1554.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  1555.  * the pressure crossed that threshold.
  1556.  *
  1557.  * TABLETA_ButtonBits:        ti_Data is a long integer whose bits are to
  1558.  * be interpreted at the state of the first 32 buttons of the tablet.
  1559.  *
  1560.  * TABLETA_InProximity:  ti_Data is a boolean.        For tablets that support
  1561.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  1562.  * when the stylus is out of proximity.  One possible use we can forsee
  1563.  * is a mouse-blanking commodity which keys off this to blank the
  1564.  * mouse.  When this tag is absent, the stylus is assumed to be
  1565.  * in proximity.
  1566.  *
  1567.  * TABLETA_ResolutionX:  ti_Data is an unsigned long integer which
  1568.  * is the x-axis resolution in dots per inch.
  1569.  *
  1570.  * TABLETA_ResolutionY:  ti_Data is an unsigned long integer which
  1571.  * is the y-axis resolution in dots per inch.
  1572.  *)
  1573.  
  1574.   tabletaDummy       * = u.user + 03A000H;
  1575.   tabletaTabletZ     * = tabletaDummy + 001H;
  1576.   tabletaRangeZ      * = tabletaDummy + 002H;
  1577.   tabletaAngleX      * = tabletaDummy + 003H;
  1578.   tabletaAngleY      * = tabletaDummy + 004H;
  1579.   tabletaAngleZ      * = tabletaDummy + 005H;
  1580.   tabletaPressure    * = tabletaDummy + 006H;
  1581.   tabletaButtonBits  * = tabletaDummy + 007H;
  1582.   tabletaInproximitY * = tabletaDummy + 008H;
  1583.   tabletaResolutionX * = tabletaDummy + 009H;
  1584.   tabletaResolutionY * = tabletaDummy + 00AH;
  1585.  
  1586. (* If your window sets WA_TabletMessages to TRUE, then it will receive
  1587.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  1588.  * field points at a TabletData structure.  This structure contains
  1589.  * additional information about the input event.
  1590.  *)
  1591.  
  1592. TYPE
  1593.   TabletData * = STRUCT
  1594.     (* Sub-pixel position of tablet, in screen coordinates,
  1595.      * scaled to fill a UWORD fraction:
  1596.      *)
  1597.     xFraction *, yFraction *: INTEGER;
  1598.  
  1599.     (* Current tablet coordinates along each axis: *)
  1600.     tabletX *, tabletY *: LONGINT;
  1601.  
  1602.     (* Tablet range along each axis.  For example, if td_TabletX
  1603.      * can take values 0-999, td_RangeX should be 1000.
  1604.      *)
  1605.     rangeX *, rangeY * : LONGINT;
  1606.  
  1607.     (* Pointer to tag-list of additional tablet attributes.
  1608.      * See <intuition/intuition.h> for the tag values.
  1609.      *)
  1610.     tagList * : u.TagListPtr;
  1611.   END;
  1612.  
  1613. (* If a tablet driver supplies a hook for td_CallBack, it will be
  1614.  * invoked in the standard hook manner.  A0 will point to the Hook
  1615.  * itself, A2 will point to the InputEvent that was sent, and
  1616.  * A1 will point to a TabletHookData structure.  The InputEvent's
  1617.  * ie_EventAddress field points at the IENewTablet structure that
  1618.  * the driver supplied.
  1619.  *
  1620.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  1621.  * should scale the ient_TabletX and ient_TabletY fields and store the
  1622.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  1623.  * ient_ScaledYFraction.
  1624.  *
  1625.  * The tablet hook must currently return NULL.        This is the only
  1626.  * acceptable return-value under V39.
  1627.  *)
  1628.  
  1629.   TabletHookData * = STRUCT
  1630.     (* Pointer to the active screen:
  1631.      * Note: if there are no open screens, thd_Screen will be NULL.
  1632.      * thd_Width and thd_Height will then describe an NTSC 640x400
  1633.      * screen.        Please scale accordingly.
  1634.      *)
  1635.     screen * : ScreenPtr;
  1636.  
  1637.     (* The width and height (measured in pixels of the active screen)
  1638.      * that your are to scale to:
  1639.      *)
  1640.     width  * : LONGINT;
  1641.     height * : LONGINT;
  1642.  
  1643.     (* Non-zero if the screen or something about the screen
  1644.      * changed since the last time you were invoked:
  1645.      *)
  1646.     screenChanged * : LONGINT;
  1647.   END;
  1648.  
  1649.  
  1650. (*
  1651.  * Package of information passed to custom and 'boopsi'
  1652.  * gadget "hook" functions.  This structure is READ ONLY.
  1653.  *)
  1654.   GadgetInfo * = STRUCT
  1655.  
  1656.     screen    - : ScreenPtr;
  1657.     window    - : WindowPtr;           (* null for screen gadgets *)
  1658.     requester - : RequesterPtr;        (* null if not GTYP_REQGADGET *)
  1659.  
  1660.     (* rendering information:
  1661.      * don't use these without cloning/locking.
  1662.      * Official way is to call ObtainRPort()
  1663.      *)
  1664.     rastPort - : g.RastPortPtr;
  1665.     layer    - : g.LayerPtr;
  1666.  
  1667.     (* copy of dimensions of screen/window/g00/req(/group)
  1668.      * that gadget resides in.  Left/Top of this box is
  1669.      * offset from window mouse coordinates to gadget coordinates
  1670.      *          screen gadgets:                 0,0 (from screen coords)
  1671.      *  window gadgets (no g00):        0,0
  1672.      *  GTYP_GZZGADGETs (borderlayer):          0,0
  1673.      *  GZZ innerlayer gadget:          borderleft, bordertop
  1674.      *  Requester gadgets:              reqleft, reqtop
  1675.      *)
  1676.     domain - : IBox;
  1677.  
  1678.     (* these are the pens for the window or screen      *)
  1679.  
  1680.     pens - : STRUCT
  1681.       detailPen - : SHORTINT;
  1682.       blockPen - : SHORTINT;
  1683.     END;
  1684.  
  1685.     (* the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  1686.      * for the screen.  Use the above for window-sensitive
  1687.      * colors.
  1688.      *)
  1689.     drInfo - : DrawInfoPtr;
  1690.  
  1691.     (* reserved space: this structure is extensible
  1692.      * anyway, but using these saves some recompilation
  1693.      *)
  1694.     reserved - : ARRAY 6 OF LONGINT;
  1695.   END;
  1696.  
  1697. (*** system private data structure for now ***)
  1698. (* prop gadget extra info       *)
  1699.   PGX = STRUCT
  1700.     container *: IBox;
  1701.     newKnob   *: IBox;
  1702.   END;
  1703.  
  1704.  
  1705. (*** User visible handles on objects, classes, messages ***)
  1706.   ObjectUsr * = LONGINT;         (* abstract handle *)
  1707.  
  1708.   ClassID   * = e.LSTRPTR;
  1709.  
  1710. (* you can use this type to point to a "generic" message,
  1711.  * in the object-oriented programming parlance.  Based on
  1712.  * the value of 'MethodID', you dispatch to processing
  1713.  * for the various message types.  The meaningful parameter
  1714.  * packet structure definitions are defined below.
  1715.  *)
  1716.   Msg * = STRUCT
  1717.     methodID * : LONGINT;
  1718.     (* method-specific data follows, some examples below *)
  1719.   END;
  1720.  
  1721.  
  1722. CONST
  1723. (*
  1724.  * Class id strings for Intuition classes.
  1725.  * There's no real reason to use the uppercase constants
  1726.  * over the lowercase strings, but this makes a good place
  1727.  * to list the names of the built-in classes.
  1728.  *)
  1729.   rootClass       * = "rootclass";             (* classusr.h   *)
  1730.   imageClass      * = "imageclass";            (* imageclass.h *)
  1731.   frameIClass     * = "frameiclass";
  1732.   sysIClass       * = "sysiclass";
  1733.   fillRectClass   * = "fillrectclass";
  1734.   gadgetClass     * = "gadgetclass";           (* gadgetclass.h *)
  1735.   propGClass      * = "propgclass";
  1736.   strGClass       * = "strgclass";
  1737.   buttonGClass    * = "buttongclass";
  1738.   frButtonClass   * = "frbuttonclass";
  1739.   groupGClass     * = "groupgclass";
  1740.   icClass         * = "icclass";               (* icclass.h    *)
  1741.   modelClass      * = "modelclass";
  1742.   itextIClass     * = "itexticlass";
  1743.   pointerClass    * = "pointerclass";          (* pointerclass.h *)
  1744.  
  1745.  
  1746. (* Dispatched method ID's
  1747.  * NOTE: Applications should use Intuition entry points, not direct
  1748.  * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  1749.  * SetGadgetAttrs, and GetAttr.
  1750.  *)
  1751.  
  1752.   dummy        * = 0100H;
  1753.   new          * = 0101H; (* 'object' parameter is "true class"   *)
  1754.   dispose      * = 0102H; (* delete self (no parameters)          *)
  1755.   set          * = 0103H; (* set attributes (in tag list)         *)
  1756.   get          * = 0104H; (* return single attribute value        *)
  1757.   addTail      * = 0105H; (* add self to a List (let root do it)  *)
  1758.   remove       * = 0106H; (* remove self from list                *)
  1759.   notify       * = 0107H; (* send to self: notify dependents      *)
  1760.   update       * = 0108H; (* notification message from somebody   *)
  1761.   addMember    * = 0109H; (* used by various classes with lists   *)
  1762.   remMember    * = 010AH; (* used by various classes with lists   *)
  1763.  
  1764. (* Parameter "Messages" passed to methods       *)
  1765.  
  1766. TYPE
  1767.  
  1768. (* OM_NEW and OM_SET    *)
  1769.   OpSet * = STRUCT (msg * : Msg)
  1770.     attrList * : u.TagListPtr;  (* new attributes       *)
  1771.     gInfo * : GadgetInfoPtr;    (* always there for gadgets,
  1772.                                  * when SetGadgetAttrs() is used,
  1773.                                  * but will be NULL for OM_NEW
  1774.                                  *)
  1775.   END;
  1776.  
  1777. (* OM_NOTIFY, and OM_UPDATE     *)
  1778.   OpUpdate * = STRUCT (msg * : Msg)
  1779.     attrList * : u.TagListPtr;  (* new attributes       *)
  1780.     gInfo * : GadgetInfoPtr;    (* non-NULL when SetGadgetAttrs or
  1781.                                  * notification resulting from gadget
  1782.                                  * input occurs.
  1783.                                  *)
  1784.     flags * : LONGSET;      (* defined below        *)
  1785.   END;
  1786.  
  1787. CONST
  1788.  
  1789. (* this flag means that the update message is being issued from
  1790.  * something like an active gadget, a la GACT_FOLLOWMOUSE.  When
  1791.  * the gadget goes inactive, it will issue a final update
  1792.  * message with this bit cleared.  Examples of use are for
  1793.  * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  1794.  * for buttons.
  1795.  *)
  1796.   interim * = 0;
  1797.  
  1798. TYPE
  1799.  
  1800. (* OM_GET       *)
  1801.   OpGet * = STRUCT (msg * : Msg)
  1802.     attrID  * : LONGINT;
  1803.     storage * : UNTRACED POINTER TO e.ADDRESS;   (* may be other types, but "int"
  1804.                                                   * types are all ULONG
  1805.                                                   *)
  1806.   END;
  1807.  
  1808. (* OM_ADDTAIL   *)
  1809.   OpAddTail * = STRUCT (msg * : Msg)
  1810.     list * : e.ListPtr;
  1811.   END;
  1812.  
  1813. (* OM_ADDMEMBER, OM_REMMEMBER   *)
  1814.   OpMember * = STRUCT (msg * : Msg)
  1815.     object * : ObjectPtr;
  1816.   END;
  1817.  
  1818.  
  1819. (*******************************************)
  1820. (*** "White box" access to struct IClass ***)
  1821. (*******************************************)
  1822.  
  1823. (* This structure is READ-ONLY, and allocated only by Intuition *)
  1824.   IClass * = STRUCT (dispatcher - : u.Hook)
  1825.     reserved   : LONGINT;            (* must be 0  *)
  1826.     super    - : IClassPtr;
  1827.     id       - : ClassID;
  1828.  
  1829.     (* where within an object is the instance data for this class? *)
  1830.     instOffset - : INTEGER;
  1831.     instSize   - : INTEGER;
  1832.  
  1833.     userData      * : e.APTR;  (* per-class data of your choice *)
  1834.     subclassCount - : LONGINT; (* how many direct subclasses?  *)
  1835.     objectCount   - : LONGINT; (* how many objects created of this class? *)
  1836.     flags         - : LONGSET;
  1837.   END;
  1838.  
  1839.   Class * = IClass;
  1840.  
  1841. CONST
  1842.   (* IClass.flags *)
  1843.   inList * = 0;        (* class is in public class list *)
  1844.  
  1845. TYPE
  1846.  
  1847. (**************************************************)
  1848. (*** "White box" access to struct _Object       ***)
  1849. (**************************************************)
  1850.  
  1851. (*
  1852.  * We have this, the instance data of the root class, PRECEDING
  1853.  * the "object".  This is so that Gadget objects are Gadget pointers,
  1854.  * and so on.  If this structure grows, it will always have o_Class
  1855.  * at the end, so the macro OCLASS(o) will always have the same
  1856.  * offset back from the pointer returned from NewObject().
  1857.  *
  1858.  * This data structure is subject to change.  Do not use the o_Node
  1859.  * embedded structure.
  1860.  *)
  1861.   Object * = STRUCT (node: e.MinNode)
  1862.     class * : IClassPtr;
  1863.   END;
  1864.  
  1865. CONST
  1866.   (* Gadget Class attributes      *)
  1867.  
  1868.   gaDummy             * = u.user + 30000H;
  1869.   gaLeft              * = gaDummy + 0001H;
  1870.   gaRelRight          * = gaDummy + 0002H;
  1871.   gaTop               * = gaDummy + 0003H;
  1872.   gaRelBottom         * = gaDummy + 0004H;
  1873.   gaWidth             * = gaDummy + 0005H;
  1874.   gaRelWidth          * = gaDummy + 0006H;
  1875.   gaHeight            * = gaDummy + 0007H;
  1876.   gaRelHeight         * = gaDummy + 0008H;
  1877.   gaText              * = gaDummy + 0009H; (* ti_Data is e.LSTRPTR *)
  1878.   gaImage             * = gaDummy + 000AH;
  1879.   gaBorder            * = gaDummy + 000BH;
  1880.   gaSelectRender      * = gaDummy + 000CH;
  1881.   gaHighlight         * = gaDummy + 000DH;
  1882.   gaDisabled          * = gaDummy + 000EH;
  1883.   gaGZZGadget         * = gaDummy + 000FH;
  1884.   gaID                * = gaDummy + 0010H;
  1885.   gaUserData          * = gaDummy + 0011H;
  1886.   gaSpecialInfo       * = gaDummy + 0012H;
  1887.   gaSelected          * = gaDummy + 0013H;
  1888.   gaEndGadget         * = gaDummy + 0014H;
  1889.   gaImmediate         * = gaDummy + 0015H;
  1890.   gaRelVerify         * = gaDummy + 0016H;
  1891.   gaFollowMouse       * = gaDummy + 0017H;
  1892.   gaRightBorder       * = gaDummy + 0018H;
  1893.   gaLeftBorder        * = gaDummy + 0019H;
  1894.   gaTopBorder         * = gaDummy + 001AH;
  1895.   gaBottomBorder      * = gaDummy + 001BH;
  1896.   gaToggleSelect      * = gaDummy + 001CH;
  1897.  
  1898.     (* internal use only, until further notice, please *)
  1899.   gaSysGadget         * = gaDummy + 001DH;
  1900.         (* bool, sets GTYP_SYSGADGET field in type      *)
  1901.   gaSysGType          * = gaDummy + 001EH;
  1902.         (* e.g., GTYP_WUPFRONT, ...     *)
  1903.  
  1904.   gaPrevious          * = gaDummy + 001FH;
  1905.         (* previous gadget (or (struct Gadget ** )) in linked list
  1906.          * NOTE: This attribute CANNOT be used to link new gadgets
  1907.          * into the gadget list of an open window or requester.
  1908.          * You must use AddGList().
  1909.          *)
  1910.  
  1911.   gaNext              * = gaDummy + 0020H;
  1912.          (* not implemented *)
  1913.  
  1914.   gaDrawInfo          * = gaDummy + 0021H;
  1915.         (* some fancy gadgets need to see a DrawInfo
  1916.          * when created or for layout
  1917.          *)
  1918.  
  1919. (* You should use at most ONE of gaText, gaIntuiText, and gaLabelImage *)
  1920.   gaIntuiText         * = gaDummy + 0022H;
  1921.         (* ti_Data is (struct IntuiText * ) *)
  1922.  
  1923.   gaLabelImage        * = gaDummy + 0023H;
  1924.         (* ti_Data is an image (object), used in place of
  1925.          * GadgetText
  1926.          *)
  1927.  
  1928.   gaTabCycle          * = gaDummy + 0024H;
  1929.        (* New for V37:
  1930.         * Boolean indicates that this gadget is to participate in
  1931.         * cycling activation with Tab or Shift-Tab.
  1932.         *)
  1933.  
  1934.   gaGadgetHelp       * = gaDummy + 00025H;
  1935.       (* New for V39:
  1936.        * Boolean indicates that this gadget sends gadget-help
  1937.        *)
  1938.  
  1939.   gaBounds           * = gaDummy + 00026H;
  1940.       (* New for V39:
  1941.        * ti_Data is a pointer to an IBox structure which is
  1942.        * to be copied into the extended gadget's bounds.
  1943.        *)
  1944.  
  1945.   gaRelSpecial       * = gaDummy + 00027H;
  1946.       (* New for V39:
  1947.        * Boolean indicates that this gadget has the "special relativity"
  1948.        * property, which is useful for certain fancy relativity
  1949.        * operations through the GM_LAYOUT method.
  1950.        *)
  1951.  
  1952.  
  1953.  
  1954. (* PROPGCLASS attributes *)
  1955.  
  1956.   pgaDummy       * = u.user  + 31000H;
  1957.   pgaFreedom     * = pgaDummy + 0001H;
  1958.   (* only one of FREEVERT or FREEHORIZ *)
  1959.   pgaBorderless  * = pgaDummy + 0002H;
  1960.   pgaHorizPot    * = pgaDummy + 0003H;
  1961.   pgaHorizBody   * = pgaDummy + 0004H;
  1962.   pgaVertPot     * = pgaDummy + 0005H;
  1963.   pgaVertBody    * = pgaDummy + 0006H;
  1964.   pgaTotal       * = pgaDummy + 0007H;
  1965.   pgaVisible     * = pgaDummy + 0008H;
  1966.   pgaTop         * = pgaDummy + 0009H;
  1967.   pgaNewLook     * = pgaDummy + 000AH;
  1968.  
  1969. (* STRGCLASS attributes *)
  1970.  
  1971.   stringaDummy           * = u.user + 32000H;
  1972.   stringaMaxChars        * = stringaDummy + 0001H;
  1973.  
  1974. (* Note:  There is a minor problem with Intuition when using boopsi integer
  1975.  * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  1976.  * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  1977.  * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  1978.  * FreeMem() to occur.
  1979.  *)
  1980.  
  1981.   stringaBuffer          * = stringaDummy + 0002H;
  1982.   stringaUndoBuffer      * = stringaDummy + 0003H;
  1983.   stringaWorkBuffer      * = stringaDummy + 0004H;
  1984.   stringaBufferPos       * = stringaDummy + 0005H;
  1985.   stringaDispPos         * = stringaDummy + 0006H;
  1986.   stringaAltKeyMap       * = stringaDummy + 0007H;
  1987.   stringaFont            * = stringaDummy + 0008H;
  1988.   stringaPens            * = stringaDummy + 0009H;
  1989.   stringaActivePens      * = stringaDummy + 000AH;
  1990.   stringaEditHook        * = stringaDummy + 000BH;
  1991.   stringaEditModes       * = stringaDummy + 000CH;
  1992.  
  1993. (* booleans *)
  1994.   stringaReplaceMode     * = stringaDummy + 000DH;
  1995.   stringaFixedFieldMode  * = stringaDummy + 000EH;
  1996.   stringaNoFilterMode    * = stringaDummy + 000FH;
  1997.  
  1998.   stringaJustification   * = stringaDummy + 0010H;
  1999.   (* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT *)
  2000.   stringaLongVal         * = stringaDummy + 0011H;
  2001.   stringaTextVal         * = stringaDummy + 0012H;
  2002.  
  2003.   stringaExitHelp        * = stringaDummy + 0013H;
  2004.         (* STRINGA_ExitHelp is new for V37, and ignored by V36.
  2005.          * Set this if you want the gadget to exit when Help is
  2006.          * pressed.  Look for a code of 0x5F, the rawkey code for Help
  2007.          *)
  2008.  
  2009.   sgDefaultMaxChars      * = 128;
  2010.  
  2011. (* Gadget Layout related attributes     *)
  2012.  
  2013.   layoutaDummy           * = u.user + 38000H;
  2014.   layoutaLayoutObj       * = layoutaDummy + 0001H;
  2015.   layoutaSpacing         * = layoutaDummy + 0002H;
  2016.   layoutaOrientation     * = layoutaDummy + 0003H;
  2017.  
  2018. (* orientation values   *)
  2019.   lorientNone   * = 0;
  2020.   lorientHoriz  * = 1;
  2021.   lorientVert   * = 2;
  2022.  
  2023.  
  2024. (* Gadget Method ID's   *)
  2025.  
  2026.   gmDummy       * = -1;    (* not used for anything                   *)
  2027.   gmHitTest     * =  0;    (* return GMR_GADGETHIT if you are clicked on
  2028.                             * (whether or not you are disabled).
  2029.                             *)
  2030.   gmRender      * = 1;     (* draw yourself, in the appropriate state *)
  2031.   gmGoActive    * = 2;     (* you are now going to be fed input    *)
  2032.   gmHandleInput * = 3;     (* handle that input                    *)
  2033.   gmGoInactive  * = 4;     (* whether or not by choice, you are done  *)
  2034.   gmHelpTest    * = 5;     (* Will you send gadget help if the mouse is
  2035.                             * at the specified coordinates?  See below
  2036.                             * for possible GMR_ values.
  2037.                             *)
  2038.   gmLayout      * = 6;     (* re-evaluate your size based on the GadgetInfo
  2039.                             * Domain.  Do NOT re-render yourself yet, you
  2040.                             * will be called when it is time...
  2041.                             *)
  2042.  
  2043. TYPE
  2044.  
  2045. (* Parameter "Messages" passed to gadget class methods  *)
  2046.  
  2047. (* GM_HITTEST and GM_HELPTEST send this message.
  2048.  * For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  2049.  * select box.        For GM_HELPTEST, the coordinates are relative to
  2050.  * the gadget bounding box (which defaults to the select box).
  2051.  *)
  2052. (* GM_HITTEST   *)
  2053.   HitTest * = STRUCT (msg * : Msg)
  2054.     gInfo * : GadgetInfoPtr;
  2055.     mouse * : g.Point;
  2056.   END;
  2057.  
  2058.  
  2059. CONST
  2060.  (* For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  2061.  * otherwise return zero.
  2062.  *
  2063.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  2064.  * Typically, return GMR_HELPHIT if you were hit.
  2065.  * It is possible to pass a UWORD to the application via the Code field
  2066.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  2067.  * the UWORD-sized result you wish to return.
  2068.  *
  2069.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  2070.  * mean "nothing particular" to the application.
  2071.  *)
  2072.  
  2073.   gadgetHit   * = 000000004;    (* GM_HITTEST hit *)
  2074.  
  2075.   noHelpHit   * = 000000000H;   (* GM_HELPTEST didn't hit *)
  2076.   helpHit     * = 0FFFFFFFFH;   (* GM_HELPTEST hit, return code = ~0 *)
  2077.   helpCode    * = 000010000H;   (* GM_HELPTEST hit, return low word as code *)
  2078.  
  2079.  
  2080. TYPE
  2081.  
  2082. (* GM_RENDER    *)
  2083.   Render * = STRUCT (msg * : Msg)
  2084.     gInfo * : GadgetInfoPtr;     (* gadget context               *)
  2085.     rPort * : g.RastPortPtr;     (* all ready for use            *)
  2086.     redraw * : LONGINT;          (* might be a "highlight pass"  *)
  2087.   END;
  2088.  
  2089. CONST
  2090.  
  2091. (* values of gpr_Redraw *)
  2092.   gRedrawUpdate * = 2;    (* incremental update, e.g. prop slider *)
  2093.   gRedrawRedraw * = 1;    (* redraw gadget        *)
  2094.   gRedrawToggle * = 0;    (* toggle highlight, if applicable      *)
  2095.  
  2096. TYPE
  2097.  
  2098. (* GM_GOACTIVE, GM_HANDLEINPUT  *)
  2099.   Input * = STRUCT (msg * : Msg)
  2100.     gInfo * : GadgetInfoPtr;
  2101.     iEvent * : ie.InputEventDummyPtr;
  2102.     termination * : e.APTR;
  2103.     mouse * : g.Point;
  2104.  
  2105.     (* (V39) Pointer to TabletData structure, if this event originated
  2106.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  2107.      * not.
  2108.      *
  2109.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  2110.      * IT WILL BE INVALID!
  2111.      *)
  2112.     tabletData * : TabletDataPtr;
  2113.   END;
  2114.  
  2115. CONST
  2116.  
  2117. (* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    *)
  2118. (* return GMR_MEACTIVE (0) alone if you want more input.
  2119.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  2120.  * GMR_VERIFY.
  2121.  *)
  2122.   gmrMeActive    * = 0;
  2123.   gmrNoReuse     * = 2;
  2124.   gmrReuse       * = 4;
  2125.   gmrVerify      * = 8;       (* you MUST set gpi_Termination *)
  2126.  
  2127.  
  2128. (* New for V37:
  2129.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  2130.  * which instructs Intuition to activate the next or previous gadget
  2131.  * that has GFLG_TABCYCLE set.
  2132.  *)
  2133.   gmrNextActive  * = 16;
  2134.   gmrPrevActive  * = 32;
  2135.  
  2136. TYPE
  2137.  
  2138.   GoInactive * = STRUCT (msg * : Msg)
  2139.     gInfo * : GadgetInfoPtr;
  2140.     (* V37 field only!        DO NOT attempt to read under V36! *)
  2141.     abort * : LONGINT;                (* gpgi_Abort=1 if gadget was aborted
  2142.                                        * by Intuition and 0 if gadget went
  2143.                                        * inactive at its own request
  2144.                                        *)
  2145.   END;
  2146.  
  2147. (* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  2148.  * the gadget is added to the window (or when the window opens, if
  2149.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  2150.  * list), or when the window is resized.  Your gadget can set the
  2151.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  2152.  * changing the interpretation of your gadget select box.  This
  2153.  * allows for completely arbitrary resizing/repositioning based on
  2154.  * window size.
  2155.  *)
  2156. (* GM_LAYOUT *)
  2157.   Layout * = STRUCT (msg * : Msg)
  2158.     gInfo * : GadgetInfoPtr;
  2159.     initial *: LONGINT;    (* non-zero if this method was invoked
  2160.                             * during AddGList() or OpenWindow()
  2161.                             * time.  zero if this method was invoked
  2162.                             * during window resizing.
  2163.                             *)
  2164.   END;
  2165.  
  2166.  
  2167. CONST
  2168.  (* ICClass: *)
  2169.  
  2170.   icmDummy       * = 00401H;       (* used for nothing             *)
  2171.   icmSetLoop     * = 00402H;       (* set/increment loop counter   *)
  2172.   icmClearLoop   * = 00403H;       (* clear/decrement loop counter *)
  2173.   icmCheckLoop   * = 00404H;       (* set/increment loop           *)
  2174.  
  2175. (* no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP  *)
  2176.  
  2177. (* interconnection attributes used by icclass, modelclass, and gadgetclass *)
  2178.   icaDummy       * = u.user + 040000H;
  2179.   icaTarget      * = icaDummy + 1;
  2180.   (* interconnection target               *)
  2181.   icaMap         * = icaDummy + 2;
  2182.   (* interconnection map tagitem list     *)
  2183.   icSpecialCode  * = icaDummy + 3;
  2184.   (* a "pseudo-attribute", see below.     *)
  2185.  
  2186. (* Normally, the value for ICA_TARGET is some object pointer,
  2187.  * but if you specify the special value ICTARGET_IDCMP, notification
  2188.  * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  2189.  * IDCMP port.  See the definition of IDCMP_IDCMPUPDATE.
  2190.  *
  2191.  * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  2192.  * specify will be applied to derive the attribute list that is
  2193.  * sent with the IDCMP_IDCMPUPDATE message.  If you specify a map list
  2194.  * which results in the attribute tag id ICSPECIAL_CODE, the
  2195.  * lower sixteen bits of the corresponding ti_Data value will
  2196.  * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.
  2197.  *)
  2198.   icTargetIDCMP * = -LONGSET{};
  2199.  
  2200.  
  2201. (* ImageClass: *)
  2202.  
  2203.   customImageDepth * = -1;
  2204. (* if image.depth is this, it's a new Image class object *)
  2205.  
  2206. (******************************************************)
  2207.   iaDummy                * = u.user + 20000H;
  2208.   iaLeft                 * = iaDummy + 001H;
  2209.   iaTop                  * = iaDummy + 002H;
  2210.   iaWidth                * = iaDummy + 003H;
  2211.   iaHeight               * = iaDummy + 004H;
  2212.   iaFGPen                * = iaDummy + 005H;
  2213.               (* iaFGPen also means "PlanePick"  *)
  2214.   iaBGPen                * = iaDummy + 006H;
  2215.               (* iaBGPen also means "PlaneOnOff" *)
  2216.   iaData                 * = iaDummy + 007H;
  2217.               (* bitplanes, for classic image,
  2218.                * other image classes may use it for other things
  2219.                *)
  2220.   iaLineWidth            * = iaDummy + 008H;
  2221.   iaPens                 * = iaDummy + 00EH;
  2222.               (* pointer to UWORD pens[],
  2223.                * ala DrawInfo.Pens, MUST be
  2224.                * terminated by ~0.  Some classes can
  2225.                * choose to have this, or SYSiaDrawInfo,
  2226.                * or both.
  2227.                *)
  2228.   iaResolution           * = iaDummy + 00FH;
  2229.               (* packed uwords for x/y resolution into a longword
  2230.                * ala DrawInfo.Resolution
  2231.                *)
  2232.  
  2233. (**** see class documentation to learn which    *****)
  2234. (**** classes recognize these                   *****)
  2235.   iaAPattern             * = iaDummy + 010H;
  2236.   iaAPatSize             * = iaDummy + 011H;
  2237.   iaMode                 * = iaDummy + 012H;
  2238.   iaFont                 * = iaDummy + 013H;
  2239.   iaOutline              * = iaDummy + 014H;
  2240.   iaRecessed             * = iaDummy + 015H;
  2241.   iaDoubleEmboss         * = iaDummy + 016H;
  2242.   iaEdgesOnly            * = iaDummy + 017H;
  2243.  
  2244. (**** "sysiclass" attributes                    *****)
  2245.   sysiaSize              * = iaDummy + 00BH;
  2246.               (* # define's below          *)
  2247.   sysiaDepth             * = iaDummy + 00CH;
  2248.               (* this is unused by Intuition.  sysiaDrawInfo
  2249.                * is used instead for V36
  2250.                *)
  2251.   sysiaWhich             * = iaDummy + 00DH;
  2252.               (* see # define's below      *)
  2253.   sysiaDrawInfo          * = iaDummy + 018H;
  2254.               (* pass to sysiclass, please *)
  2255.  
  2256. (*****  obsolete: don't use these, use iaPens  *****)
  2257.   sysiaPens              * = iaPens;
  2258.   iaShadowPen            * = iaDummy + 009H;
  2259.   iaHighlightPen         * = iaDummy + 00AH;
  2260.  
  2261. (* New for V39: *)
  2262.   sysiaReferenceFont     * = iaDummy + 019H;
  2263.                   (* Font to use as reference for scaling
  2264.                    * certain sysiclass images
  2265.                    *)
  2266.   iaSupportsDisable      * = iaDummy + 01AH;
  2267.                   (* By default, Intuition ghosts gadgets itself,
  2268.                    * instead of relying on IDS_DISABLED or
  2269.                    * IDS_SELECTEDDISABLED.  An imageclass that
  2270.                    * supports these states should return this attribute
  2271.                    * as TRUE.  You cannot set or clear this attribute,
  2272.                    * however.
  2273.                    *)
  2274.  
  2275.   iaFrameType            * = iaDummy + 01BH;
  2276.                   (* Starting with V39, FrameIClass recognizes
  2277.                    * several standard types of frame.  Use one
  2278.                    * of the FRAME_ specifiers below.  Defaults
  2279.                    * to FRAME_DEFAULT.
  2280.                    *)
  2281.  
  2282. (** next attribute: (iaDummy + 0x1c)   **)
  2283. (*************************************************)
  2284.  
  2285. (* data values for sysiaSize   *)
  2286.   sysisizeMedres * = 0;
  2287.   sysisizeLowres * = 1;
  2288.   sysisizeHires  * = 2;
  2289.  
  2290. (*
  2291.  * sysiaWhich tag data values:
  2292.  * Specifies which system gadget you want an image for.
  2293.  * Some numbers correspond to internal Intuition # defines
  2294.  *)
  2295.   depthImage  * = 000H; (* Window depth gadget image *)
  2296.   zoomImage   * = 001H; (* Window zoom gadget image *)
  2297.   sizeImage   * = 002H; (* Window sizing gadget image *)
  2298.   closeImage  * = 003H; (* Window close gadget image *)
  2299.   sDepthImage * = 005H; (* Screen depth gadget image *)
  2300.   leftImage   * = 00AH; (* Left-arrow gadget image *)
  2301.   upImage     * = 00BH; (* Up-arrow gadget image *)
  2302.   rightImage  * = 00CH; (* Right-arrow gadget image *)
  2303.   downImage   * = 00DH; (* Down-arrow gadget image *)
  2304.   checkImage  * = 00EH; (* GadTools checkbox image *)
  2305.   mxImage     * = 00FH; (* GadTools mutual exclude "button" image *)
  2306. (* New for V39: *)
  2307.   menucheck   * = 010H; (* Menu checkmark image *)
  2308.   amigakey    * = 011H; (* Menu Amiga-key image *)
  2309.  
  2310. (* Data values for IA_FrameType (recognized by FrameIClass)
  2311.  *
  2312.  * FRAME_DEFAULT:  The standard V37-type frame, which has
  2313.  *    thin edges.
  2314.  * FRAME_BUTTON:  Standard button gadget frames, having thicker
  2315.  *    sides and nicely edged corners.
  2316.  * FRAME_RIDGE:  A ridge such as used by standard string gadgets.
  2317.  *    You can recess the ridge to get a groove image.
  2318.  * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery
  2319.  *    for areas in AppWindows where icons may be dropped.
  2320.  *)
  2321.  
  2322.   frameDefault     * =  0;
  2323.   frameButton      * =  1;
  2324.   frameRidge       * =  2;
  2325.   frameIconDropBox * =  3;
  2326.  
  2327.  
  2328. (* image message id's   *)
  2329.   imDraw       * = 0202H;  (* draw yourself, with "state"          *)
  2330.   imHitTest    * = 0203H;  (* return TRUE if click hits image      *)
  2331.   imErase      * = 0204H;  (* erase yourself                       *)
  2332.   imMove       * = 0205H;  (* draw new and erase old, smoothly     *)
  2333.  
  2334.   imDrawFrame  * = 0206H;  (* draw with specified dimensions       *)
  2335.   imFrameBox   * = 0207H;  (* get recommended frame around some box*)
  2336.   imHitFrame   * = 0208H;  (* hittest with dimensions              *)
  2337.   imEraseFrame * = 0209H; (* hittest with dimensions              *)
  2338.  
  2339. (* image draw states or styles, for IM_DRAW *)
  2340. (* Note that they have no bitwise meanings (unfortunately) *)
  2341.   idsNormal           * = 0;
  2342.   idsSelected         * = 1;    (* for selected gadgets     *)
  2343.   idsDisabled         * = 2;    (* for disabled gadgets     *)
  2344.   idsBusy             * = 3;    (* for future functionality *)
  2345.   idsIndeterminate    * = 4;    (* for future functionality *)
  2346.   idsInactiveNormal   * = 5;    (* normal, in inactive window border *)
  2347.   idsInactiveSelected * = 6;    (* selected, in inactive border *)
  2348.   idsInactiveDisabled * = 7;    (* disabled, in inactive border *)
  2349.   idsSelectedDisabled * = 8;    (* disabled and selected    *)
  2350.  
  2351. TYPE
  2352.  
  2353. (* IM_FRAMEBOX  *)
  2354.   FrameBox * = STRUCT (msg * : Msg)
  2355.     contentsBox * : IBoxPtr;       (* input: relative box of contents *)
  2356.     frameBox * : IBoxPtr;          (* output: rel. box of encl frame  *)
  2357.     drInfo * : DrawInfoPtr;
  2358.     frameFlags * : LONGSET;
  2359.   END;
  2360.  
  2361. CONST
  2362.  
  2363.   frameFSpecify * = 0;   (* Make do with the dimensions of FrameBox
  2364.                           * provided.
  2365.                           *)
  2366.  
  2367. TYPE
  2368.   Dimensions * = STRUCT  (* used by the following structs *)
  2369.     width * : INTEGER;
  2370.     height * : INTEGER;
  2371.   END;
  2372.  
  2373. (* IM_DRAW, IM_DRAWFRAME        *)
  2374.   Draw * = STRUCT (msg * : Msg)
  2375.     rPort * : g.RastPortPtr;
  2376.     offset * : g.Point;
  2377.     state * : LONGINT;
  2378.     drInfo * : DrawInfoPtr;
  2379.  
  2380.     (* these parameters only valid for IM_DRAWFRAME *)
  2381.     dimensions * : Dimensions;
  2382.   END;
  2383.  
  2384. (* IM_ERASE, IM_ERASEFRAME      *)
  2385. (* NOTE: This is a subset of impDraw    *)
  2386.   Erase * = STRUCT (msg * : Msg)
  2387.     rPort * : g.RastPortPtr;
  2388.     offset * : g.Point;
  2389.  
  2390.     (* these parameters only valid for IM_ERASEFRAME *)
  2391.     dimensions * : Dimensions;
  2392.   END;
  2393.  
  2394. (* IM_HITTEST, IM_HITFRAME      *)
  2395.   IMHitTest * = STRUCT (msg * : Msg)
  2396.     point * : g.Point;
  2397.  
  2398.     (* these parameters only valid for IM_HITFRAME *)
  2399.     dimensions * : Dimensions;
  2400.   END;
  2401.  
  2402. CONST
  2403.  
  2404. (* ---- pointer class --------------------------------------------- *)
  2405.  
  2406.  
  2407. (* The following tags are recognized at NewObject() time by
  2408.  * pointerclass:
  2409.  *
  2410.  * POINTERA_BitMap (struct BitMap * ) - Pointer to bitmap to
  2411.  *      get pointer imagery from.  Bitplane data need not be
  2412.  *      in chip RAM.
  2413.  * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot.
  2414.  * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot.
  2415.  * POINTERA_WordWidth (ULONG) - designed width of the pointer in words
  2416.  * POINTERA_XResolution (ULONG) - one of the POINTERXRESN_ flags below
  2417.  * POINTERA_YResolution (ULONG) - one of the POINTERYRESN_ flags below
  2418.  *
  2419.  *)
  2420.  
  2421.   pointeraDummy       * =  u.user + 039000H;
  2422.  
  2423.   pointeraBitMap      * =  pointeraDummy + 001H;
  2424.   pointeraXOffset     * =  pointeraDummy + 002H;
  2425.   pointeraYOffset     * =  pointeraDummy + 003H;
  2426.   pointeraWordWidth   * =  pointeraDummy + 004H;
  2427.   pointeraXResolution * =  pointeraDummy + 005H;
  2428.   pointeraYResolution * =  pointeraDummy + 006H;
  2429.  
  2430. (* These are the choices for the POINTERA_XResolution attribute which
  2431.  * will determine what resolution pixels are used for this pointer.
  2432.  *
  2433.  * POINTERXRESN_DEFAULT (ECS-compatible pointer width)
  2434.  *      = 70 ns if SUPERHIRES-type mode, 140 ns if not
  2435.  *
  2436.  * POINTERXRESN_SCREENRES
  2437.  *      = Same as pixel speed of screen
  2438.  *
  2439.  * POINTERXRESN_LORES (pointer always in lores-like pixels)
  2440.  *      = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  2441.  *
  2442.  * POINTERXRESN_HIRES (pointer always in hires-like pixels)
  2443.  *      = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  2444.  *
  2445.  * POINTERXRESN_140NS (pointer always in 140 ns pixels)
  2446.  *      = 140 ns always
  2447.  *
  2448.  * POINTERXRESN_70NS (pointer always in 70 ns pixels)
  2449.  *      = 70 ns always
  2450.  *
  2451.  * POINTERXRESN_35NS (pointer always in 35 ns pixels)
  2452.  *      = 35 ns always
  2453.  *)
  2454.  
  2455.   pointerXResnDefault   * = 0;
  2456.   pointerXResn140ns     * = 1;
  2457.   pointerXResn70ns      * = 2;
  2458.   pointerXResn35ns      * = 3;
  2459.  
  2460.   pointerXResnScreenRes * = 4;
  2461.   pointerXResnLores     * = 5;
  2462.   pointerXResnHires     * = 6;
  2463.  
  2464. (* These are the choices for the POINTERA_YResolution attribute which
  2465.  * will determine what vertical resolution is used for this pointer.
  2466.  *
  2467.  * POINTERYRESN_DEFAULT
  2468.  *      = In 15 kHz modes, the pointer resolution will be the same
  2469.  *        as a non-interlaced screen.  In 31 kHz modes, the pointer
  2470.  *        will be doubled vertically.  This means there will be about
  2471.  *        200-256 pointer lines per screen.
  2472.  *
  2473.  * POINTERYRESN_HIGH
  2474.  * POINTERYRESN_HIGHASPECT
  2475.  *      = Where the hardware/software supports it, the pointer resolution
  2476.  *        will be high.  This means there will be about 400-480 pointer
  2477.  *        lines per screen.  POINTERYRESN_HIGHASPECT also means that
  2478.  *        when the pointer comes out double-height due to hardware/software
  2479.  *        restrictions, its width would be doubled as well, if possible
  2480.  *        (to preserve aspect).
  2481.  *
  2482.  * POINTERYRESN_SCREENRES
  2483.  * POINTERYRESN_SCREENRESASPECT
  2484.  *      = Will attempt to match the vertical resolution of the pointer
  2485.  *        to the screen's vertical resolution.  POINTERYRESN_SCREENASPECT also
  2486.  *        means that when the pointer comes out double-height due to
  2487.  *        hardware/software restrictions, its width would be doubled as well,
  2488.  *        if possible (to preserve aspect).
  2489.  *
  2490.  *)
  2491.  
  2492.   pointerYResnDefault         * = 0;
  2493.   pointerYResnHigh            * = 2;
  2494.   pointerYResnHighAspect      * = 3;
  2495.   pointerYResnScreenRes       * = 4;
  2496.   pointerYResnScreenResAspect * = 5;
  2497.  
  2498. (* Compatibility note:
  2499.  *
  2500.  * The AA chipset supports variable sprite width and resolution, but
  2501.  * the setting of width and resolution is global for all sprites.
  2502.  * When no other sprites are in use, Intuition controls the sprite
  2503.  * width and sprite resolution for correctness based on pointerclass
  2504.  * attributes specified by the creator of the pointer.  Intuition
  2505.  * controls sprite resolution with the VTAG_DEFSPRITERESN_SET tag
  2506.  * to VideoControl().  Applications can override this on a per-viewport
  2507.  * basis with the VTAG_SPRITERESN_SET tag to VideoControl().
  2508.  *
  2509.  * If an application uses a sprite other than the pointer sprite,
  2510.  * Intuition will automatically regenerate the pointer sprite's image in
  2511.  * a compatible width.  This might involve BitMap scaling of the imagery
  2512.  * you supply.
  2513.  *
  2514.  * If any sprites other than the pointer sprite were obtained with the
  2515.  * old GetSprite() call, Intuition assumes that the owner of those
  2516.  * sprites is unaware of sprite resolution, hence Intuition will set the
  2517.  * default sprite resolution (VTAG_DEFSPRITERESN_SET) to ECS-compatible,
  2518.  * instead of as requested by the various pointerclass attributes.
  2519.  *
  2520.  * No resolution fallback occurs when applications use ExtSprites.
  2521.  * Such applications are expected to use VTAG_SPRITERESN_SET tag if
  2522.  * necessary.
  2523.  *
  2524.  * NB:  Under release V39, only sprite width compatibility is implemented.
  2525.  * Sprite resolution compatibility was added for V40.
  2526.  *)
  2527.  
  2528.  
  2529. (* ======================================================================== *)
  2530. (* === Preferences ======================================================== *)
  2531. (* ======================================================================== *)
  2532.  
  2533. (* these are the definitions for the printer configurations *)
  2534.   filenameSize * = 30;      (* Filename size *)
  2535.   devNameSize  * = 16;      (* Device-name size *)
  2536.  
  2537.   pointerSize * = (1 + 16 + 1) * 2;    (* Size of Pointer data buffer *)
  2538.  
  2539. (* These defines are for the default font size.  These actually describe the
  2540.  * height of the defaults fonts.  The default font type is the topaz
  2541.  * font, which is a fixed width font that can be used in either
  2542.  * eighty-column or sixty-column mode.  The Preferences structure reflects
  2543.  * which is currently selected by the value found in the variable FontSize,
  2544.  * which may have either of the values defined below.  These values actually
  2545.  * are used to select the height of the default font.  By changing the
  2546.  * height, the resolution of the font changes as well.
  2547.  *)
  2548.   topazEighty * = 8;
  2549.   topazSixty * = 9;
  2550.  
  2551. TYPE
  2552.   Filename * = ARRAY filenameSize OF CHAR;
  2553.  
  2554. (* Note:  Starting with V36, and continuing with each new version of
  2555.  * Intuition, an increasing number of fields of struct Preferences
  2556.  * are ignored by SetPrefs().  (Some fields are obeyed only at the
  2557.  * initial SetPrefs(), which comes from the devs:system-configuration
  2558.  * file).  Elements are generally superseded as new hardware or software
  2559.  * features demand more information than fits in struct Preferences.
  2560.  * Parts of struct Preferences must be ignored so that applications
  2561.  * calling GetPrefs(), modifying some other part of struct Preferences,
  2562.  * then calling SetPrefs(), don't end up truncating the extended
  2563.  * data.
  2564.  *
  2565.  * Consult the autodocs for SetPrefs() for further information as
  2566.  * to which fields are not always respected.
  2567.  *)
  2568.  
  2569.   Preferences * = STRUCT
  2570.  
  2571.     (* the default font height *)
  2572.     fontHeight  * : SHORTINT;          (* height for system default font  *)
  2573.  
  2574.     (* constant describing what's hooked up to the port *)
  2575.     printerPort * : SHORTINT;          (* printer port connection         *)
  2576.  
  2577.     (* the baud rate of the port *)
  2578.     baudRate    * : INTEGER;           (* baud rate for the serial port   *)
  2579.  
  2580.     (* various timing rates *)
  2581.     keyRptSpeed * : t.TimeVal;         (* repeat speed for keyboard       *)
  2582.     keyRptDelay * : t.TimeVal;         (* Delay before keys repeat        *)
  2583.     doubleClick * : t.TimeVal;         (* Interval allowed between clicks *)
  2584.  
  2585.     (* Intuition Pointer data *)
  2586.     pointerMatrix * : ARRAY pointerSize OF INTEGER;  (* Definition of pointer sprite    *)
  2587.     xOffset      * : SHORTINT;         (* X-Offset for active 'bit'       *)
  2588.     yOffset      * : SHORTINT;         (* Y-Offset for active 'bit'       *)
  2589.     color17      * : INTEGER;          (***********************************)
  2590.     color18      * : INTEGER;          (* Colours for sprite pointer      *)
  2591.     color19      * : INTEGER;          (***********************************)
  2592.     pointerTicks * : INTEGER;          (* Sensitivity of the pointer      *)
  2593.  
  2594.     (* Workbench Screen colors *)
  2595.     color0 * : INTEGER;                (***********************************)
  2596.     color1 * : INTEGER;                (*  Standard default colours       *)
  2597.     color2 * : INTEGER;                (*   Used in the Workbench         *)
  2598.     color3 * : INTEGER;                (***********************************)
  2599.  
  2600.     (* positioning data for the Intuition View *)
  2601.     viewXOffset  * : SHORTINT;         (* Offset for top lefthand corner  *)
  2602.     viewYOffset  * : SHORTINT;         (* X and Y dimensions              *)
  2603.     viewInitX    * ,
  2604.     viewInitY    * : INTEGER;          (* View initial offset values      *)
  2605.  
  2606.     enableCLI    * : SET;              (* CLI availability switch *)
  2607.  
  2608.     (* printer configurations *)
  2609.     printerType     * : INTEGER;       (* printer type            *)
  2610.     printerFilename * : Filename;      (* file for printer        *)
  2611.  
  2612.     (* print format and quality configurations *)
  2613.     printPitch       * : INTEGER;      (* print pitch                     *)
  2614.     printQuality     * : INTEGER;      (* print quality                   *)
  2615.     printSpacing     * : INTEGER;      (* number of lines per inch        *)
  2616.     printLeftMargin  * : INTEGER;      (* left margin in characters       *)
  2617.     printRightMargin * : INTEGER;      (* right margin in characters      *)
  2618.     printImage       * : INTEGER;      (* positive or negative            *)
  2619.     printAspect      * : INTEGER;      (* horizontal or vertical          *)
  2620.     printShade       * : INTEGER;      (* b&w, half-tone, or color        *)
  2621.     printThreshold   * : INTEGER;      (* darkness ctrl for b/w dumps     *)
  2622.  
  2623.     (* print paper descriptors *)
  2624.     paperSize   * : INTEGER;           (* paper size                      *)
  2625.     paperLength * : INTEGER;           (* paper length in number of lines *)
  2626.     paperType   * : INTEGER;           (* continuous or single sheet      *)
  2627.  
  2628.     (* Serial device settings: These are six nibble-fields in three bytes *)
  2629.     (* (these look a little strange so the defaults will map out to zero) *)
  2630.     serRWBits  * : e.BYTE;              (* upper nibble = (8-number of read bits)   *)
  2631.                                        (* lower nibble = (8-number of write bits)   *)
  2632.     serStopBuf * : e.BYTE;             (* upper nibble = (number of stop bits - 1)  *)
  2633.                                        (* lower nibble = (table value for BufSize)  *)
  2634.     serParShk  * : e.BYTE;             (* upper nibble = (value for Parity setting) *)
  2635.                                        (* lower nibble = (value for Handshake mode) *)
  2636.     laceWB     * : SHORTSET;           (* if workbench is to be interlaced          *)
  2637.  
  2638.     pad        *: ARRAY 12 OF e.UBYTE;
  2639.     prtDevName *: ARRAY devNameSize OF CHAR; (* device used by printer.device
  2640.                                               * (omit the ".device")
  2641.                                               *)
  2642.     defaultPrtUnit * : SHORTINT;       (* default unit opened by printer.device *)
  2643.     defaultSerUnit * : SHORTINT;       (* default serial unit *)
  2644.  
  2645.     rowSizeChange    * : SHORTINT;     (* affect NormalDisplayRows/Columns     *)
  2646.     columnSizeChange * : SHORTINT;
  2647.  
  2648.     printFlags     * : SET;            (* user preference flags *)
  2649.     printMaxWidth  * : INTEGER;        (* max width of printed picture in 10ths/in  *)
  2650.     printMaxHeight * : INTEGER;        (* max height of printed picture in 10ths/in *)
  2651.     printDensity   * : SHORTINT;       (* print density *)
  2652.     printXOffset   * : SHORTINT;       (* offset of printed picture in 10ths/inch *)
  2653.  
  2654.     width   * : INTEGER;               (* override default workbench width  *)
  2655.     height  * : INTEGER;               (* override default workbench height *)
  2656.     depth   * : SHORTINT;              (* override default workbench depth  *)
  2657.  
  2658.     extSize * : SHORTINT;              (* extension information -- do not touch! *)
  2659.                                        (* extension size in blocks of 64 bytes   *)
  2660.   END;
  2661.  
  2662. CONST
  2663.  
  2664. (* Workbench Interlace (use one bit) *)
  2665.   laceWB          * = 0;
  2666.   lwReserved      * = 1;          (* internal use only *)
  2667.  
  2668. (* Enable_CLI   *)
  2669.   screenDrag      * = 14;
  2670.   mouseAccel      * = 15;
  2671.  
  2672. (* PrinterPort *)
  2673.   parallelPrinter * = 00H;
  2674.   serialPrinter   * = 01H;
  2675.  
  2676. (* BaudRate *)
  2677.   baud110      * = 000H;
  2678.   baud300      * = 001H;
  2679.   baud1200     * = 002H;
  2680.   baud2400     * = 003H;
  2681.   baud4800     * = 004H;
  2682.   baud9600     * = 005H;
  2683.   baud19200    * = 006H;
  2684.   baudMidi     * = 007H;
  2685.  
  2686. (* PaperType *)
  2687.   fanfold      * = 000H;
  2688.   single       * = 080H;
  2689.  
  2690. (* PrintPitch *)
  2691.   pica         * = 0000H;
  2692.   elite        * = 0400H;
  2693.   fine         * = 0800H;
  2694.  
  2695. (* PrintQuality *)
  2696.   draft        * = 0000H;
  2697.   letter       * = 0100H;
  2698.  
  2699. (* PrintSpacing *)
  2700.   sixLPI       * = 0000H;
  2701.   eightLPI     * = 0200H;
  2702.  
  2703. (* Print Image *)
  2704.   imagePositive * = 000H;
  2705.   imageNegative * = 001H;
  2706.  
  2707. (* PrintAspect *)
  2708.   aspectHoriz  * = 000H;
  2709.   aspectVert   * = 001H;
  2710.  
  2711. (* PrintShade *)
  2712.   shadeBW        * = 000H;
  2713.   shadeGreyScale * = 001H;
  2714.   shadeColor     * = 002H;
  2715.  
  2716. (* PaperSize (all paper sizes have a zero in the lowest nybble) *)
  2717.   usLetter     * = 000H;
  2718.   usLegal      * = 010H;
  2719.   nTractor     * = 020H;
  2720.   wTractor     * = 030H;
  2721.   custom       * = 040H;
  2722.  
  2723. (* PrinterType *)
  2724.   customName           * = 000H;
  2725.   alphaP101            * = 001H;
  2726.   brother15XL          * = 002H;
  2727.   cbmMps1000           * = 003H;
  2728.   diab630              * = 004H;
  2729.   diabAdvD25           * = 005H;
  2730.   diabC150             * = 006H;
  2731.   epson                * = 007H;
  2732.   epsonJX80            * = 008H;
  2733.   okimate20            * = 009H;
  2734.   qumeLP20             * = 00AH;
  2735. (* new printer entries, 3 October 1985 *)
  2736.   hpLaserjet           * = 00BH;
  2737.   hpLaserjetPlus       * = 00CH;
  2738.  
  2739. (* Serial Input Buffer Sizes *)
  2740.   buf512     * = 000H;
  2741.   buf1024    * = 001H;
  2742.   buf2048    * = 002H;
  2743.   buf4096    * = 003H;
  2744.   buf8000    * = 004H;
  2745.   buf16000   * = 005H;
  2746.  
  2747. (* Serial Bit Masks *)
  2748.   readBits    * = 0F0X; (* for SerRWBits   *)
  2749.   writeBits   * = 00FX;
  2750.  
  2751.   stopBits    * = 0F0X; (* for SerStopBuf  *)
  2752.   bufSizeBits * = 00FX;
  2753.  
  2754.   parityBits  * = 0F0X; (* for SerParShk   *)
  2755.   hShakeBits  * = 00FX;
  2756.  
  2757. (* Serial Parity (upper nibble, after being shifted by
  2758.  * macro SPARNUM() )
  2759.  *)
  2760.   parityNone  * = 0;
  2761.   parityEven  * = 1;
  2762.   parityOdd   * = 2;
  2763.  
  2764. (* Serial Handshake Mode (lower nibble, after masking using
  2765.  * macro SHANKNUM() )
  2766.  *)
  2767.   shakeXon   * = 0;
  2768.   shakeRts   * = 1;
  2769.   shakeNone  * = 2;
  2770.  
  2771. (* new defines for PrintFlags *)
  2772.  
  2773.   correctRed          * = 0;  (* color correct red shades *)
  2774.   correctGreen        * = 1;  (* color correct green shades *)
  2775.   correctBlue         * = 2;  (* color correct blue shades *)
  2776.  
  2777.   centerImage         * = 3;  (* center image on paper *)
  2778.  
  2779.   ignoreDimensions    * = {}; (* ignore max width/height settings *)
  2780.   boundedDimensions   * = 4;  (* use max width/height as boundaries *)
  2781.   absoluteDimensions  * = 5;  (* use max width/height as absolutes *)
  2782.   pixelDimensions     * = 6;  (* use max width/height as prt pixels *)
  2783.   multiplyDimensions  * = 7;  (* use max width/height as multipliers *)
  2784.  
  2785.   integerScaling      * = 8;  (* force integer scaling *)
  2786.  
  2787.   orderedDithering    * = {}; (* ordered dithering *)
  2788.   halftoneDithering   * = 9;  (* halftone dithering *)
  2789.   floydDithering      * = 10; (* Floyd-Steinberg dithering *)
  2790.  
  2791.   antiAlias           * = 11; (* anti-alias image *)
  2792.   greyScale2          * = 12; (* for use with hi-res monitor *)
  2793.  
  2794. (* masks used for checking bits *)
  2795.  
  2796.   correctRGBMask      * = {correctRed,correctGreen,correctBlue};
  2797.   dimensionsMask      * = {boundedDimensions,absoluteDimensions,pixelDimensions,multiplyDimensions};
  2798.   ditheringMask       * = {halftoneDithering,floydDithering};
  2799.  
  2800.  
  2801. (* ======================================================================== *)
  2802. (* === DrawInfo ========================================================= *)
  2803. (* ======================================================================== *)
  2804.  
  2805. (* This is a packet of information for graphics rendering.  It originates
  2806.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  2807.  *)
  2808.  
  2809. (* You can use the Intuition version number to tell which fields are
  2810.  * present in this structure.
  2811.  *
  2812.  * DRI_VERSION of 1 corresponds to V37 release.
  2813.  * DRI_VERSION of 2 corresponds to V39, and includes three new pens
  2814.  *    and the dri_CheckMark and dri_AmigaKey fields.
  2815.  *
  2816.  * Note that sometimes applications need to create their own DrawInfo
  2817.  * structures, in which case the DRI_VERSION won't correspond exactly
  2818.  * to the OS version!!!
  2819.  *)
  2820.  
  2821.   driVersion * = 2;
  2822.  
  2823. TYPE
  2824.   DrawInfo * = STRUCT
  2825.     version * : INTEGER;      (* will be  DRI_VERSION                 *)
  2826.     numPens * : INTEGER;      (* guaranteed to be >= 9                *)
  2827.     pens * : DRIPenArrayPtr;  (* pointer to pen array                 *)
  2828.  
  2829.     font * : g.TextFontPtr;   (* screen default font                  *)
  2830.     depth * : INTEGER;        (* (initial) depth of screen bitmap     *)
  2831.  
  2832.     resolution * : g.Point;   (* from DisplayInfo database for initial display mode *)
  2833.  
  2834.     flags * : LONGSET;        (* defined below                *)
  2835. (* New for V39: dri_CheckMark, dri_AmigaKey. *)
  2836.     checkMark * : ImagePtr;   (* pointer to scaled checkmark image
  2837.                                * Will be NULL if DRI_VERSION < 2
  2838.                                *)
  2839.     amigaKey *: ImagePtr;      (* pointer to scaled Amiga-key image
  2840.                                * Will be NULL if DRI_VERSION < 2
  2841.                                *)
  2842.     reserved * : ARRAY 5 OF LONGINT;   (* avoid recompilation ;^)      *)
  2843.   END;
  2844.  
  2845. CONST
  2846.   (* DrawInfo.flags *)
  2847.   drifNewLook * = 0;    (* specified SA_Pens, full treatment *)
  2848.  
  2849. (* rendering pen number indexes into DrawInfo.dri_Pens[]        *)
  2850.   detailPen        * = 0000H;       (* compatible Intuition rendering pens  *)
  2851.   blockPen         * = 0001H;       (* compatible Intuition rendering pens  *)
  2852.   textPen          * = 0002H;       (* text on background                   *)
  2853.   shinePen         * = 0003H;       (* bright edge on 3D objects            *)
  2854.   shadowPen        * = 0004H;       (* dark edge on 3D objects              *)
  2855.   fillPen          * = 0005H;       (* active-window/selected-gadget fill   *)
  2856.   fillTextPen      * = 0006H;       (* text over FILLPEN                    *)
  2857.   backGroundPen    * = 0007H;       (* always color 0                       *)
  2858.   highLightTextPen * = 0008H;       (* special color text, on background    *)
  2859.  
  2860. (* New for V39, only present if DRI_VERSION >= 2: *)
  2861.   barDetailPen     * = 00009H;      (* text/detail in screen-bar/menus *)
  2862.   barBlockPen      * = 0000AH;      (* screen-bar/menus fill *)
  2863.   barTrimPen       * = 0000BH;      (* trim under screen-bar *)
  2864.  
  2865.   numDRIPens       * = 000CH;
  2866.  
  2867.  
  2868. (* New for V39:  It is sometimes useful to specify that a pen value
  2869.  * is to be the complement of color zero to three.  The "magic" numbers
  2870.  * serve that purpose:
  2871.  *)
  2872.   penC3 * =  0FEFCH;          (* Complement of color 3 *)
  2873.   penC2 * =  0FEFDH;          (* Complement of color 2 *)
  2874.   penC1 * =  0FEFEH;          (* Complement of color 1 *)
  2875.   penC0 * =  0FEFFH;          (* Complement of color 0 *)
  2876.  
  2877. TYPE
  2878.   DRIPenArray * = ARRAY numDRIPens OF INTEGER; (* you MUST NOT use an index
  2879.                                                 * higher than allowed for
  2880.                                                 * the actual DRI_VERSION
  2881.                                                 *)
  2882.  
  2883. (* ======================================================================== *)
  2884. (* === Screen ============================================================= *)
  2885. (* ======================================================================== *)
  2886.  
  2887. (* VERY IMPORTANT NOTE ABOUT Screen->BitMap.  In the future, bitmaps
  2888.  * will need to grow.  The embedded instance of a bitmap in the screen
  2889.  * will no longer be large enough to hold the whole description of
  2890.  * the bitmap.
  2891.  *
  2892.  * YOU ARE STRONGLY URGED to use Screen->RastPort.BitMap in place of
  2893.  * &Screen->BitMap whenever and whereever possible.
  2894.  *)
  2895.  
  2896.   Screen * = STRUCT
  2897.  
  2898.     nextScreen * : ScreenPtr;           (* linked list of screens *)
  2899.     firstWindow * : WindowPtr;          (* linked list Screen's Windows *)
  2900.  
  2901.     leftEdge * , topEdge * : INTEGER;   (* parameters of the screen *)
  2902.     width * , height * : INTEGER;       (* parameters of the screen *)
  2903.  
  2904.     mouseY * , mouseX * : INTEGER;      (* position relative to upper-left *)
  2905.  
  2906.     flags * : SET;                      (* see definitions below *)
  2907.  
  2908.     title * : e.LSTRPTR;                (* null-terminated Title text *)
  2909.     defaultTitle * : e.LSTRPTR;         (* for Windows without ScreenTitle *)
  2910.  
  2911.     (* Bar sizes for this Screen and all Window's in this Screen *)
  2912.     (* Note that BarHeight is one less than the actual menu bar
  2913.      * height.  We're going to keep this in V36 for compatibility,
  2914.      * although V36 artwork might use that extra pixel
  2915.      *
  2916.      * Also, the title bar height of a window is calculated from the
  2917.      * screen's WBorTop field, plus the font height, plus one.
  2918.      *)
  2919.     barHeight * , barVBorder * , barHBorder * ,
  2920.     menuVBorder * , menuHBorder * : SHORTINT;
  2921.     wBorTop * , wBorLeft * , wBorRight * , wBorBottom * : SHORTINT;
  2922.  
  2923.     font * : g.TextAttrPtr;             (* this screen's default font      *)
  2924.  
  2925.     (* the display data structures for this Screen *)
  2926.     viewPort * : g.ViewPort;            (* describing the Screen's display *)
  2927.     rastPort * : g.RastPort;            (* describing Screen rendering     *)
  2928.     bitMap * : g.BitMap;                (* SEE WARNING ABOVE!              *)
  2929.     layerInfo * : g.LayerInfo;          (* each screen gets a LayerInfo    *)
  2930.  
  2931.     (* Only system gadgets may be attached to a screen.
  2932.      *  You get the standard system Screen Gadgets automatically
  2933.      *)
  2934.     firstGadget * : GadgetDummyPtr;
  2935.  
  2936.     detailPen * , blockPen * : SHORTINT;    (* for bar/border/gadget rendering *)
  2937.  
  2938.     (* the following variable(s) are maintained by Intuition to support the
  2939.      * DisplayBeep() color flashing technique
  2940.      *)
  2941.     saveColor0 * : INTEGER;
  2942.  
  2943.     (* This layer is for the Screen and Menu bars *)
  2944.     barLayer * : g.LayerPtr;
  2945.  
  2946.     extData * : e.APTR;
  2947.  
  2948.     userData * : e.APTR;    (* general-purpose pointer to User data extension *)
  2949.  
  2950.     (**** Data below this point are SYSTEM PRIVATE ****)
  2951.  
  2952.   END;
  2953.  
  2954. CONST
  2955.  
  2956. (* --- FLAGS SET BY INTUITION --------------------------------------------- *)
  2957. (* The SCREENTYPE bits are reserved for describing various Screen types
  2958.  * available under Intuition.
  2959.  *)
  2960.   screenType      * = {0..3};  (* all the screens types available      *)
  2961. (* --- the definitions for the Screen Type ------------------------------- *)
  2962.   wbenchScreen    * = 0;      (* identifies the Workbench screen      *)
  2963.   publicScreen    * = 1;      (* public shared (custom) screen        *)
  2964.   customScreen    * = {0..3}; (* original custom screens              *)
  2965.  
  2966.   showTitle       * = 4;  (* this gets set by a call to ShowTitle() *)
  2967.  
  2968.   beeping           = 5;  (* set when Screen is beeping (private)   *)
  2969.  
  2970.   customBitMap    * = 6;  (* if you are supplying your own BitMap   *)
  2971.  
  2972.   screenBehind    * = 7;  (* if you want your screen to open behind
  2973.                            * already open screens
  2974.                            *)
  2975.   screenQuiet     * = 8;  (* if you do not want Intuition to render
  2976.                            * into your screen (gadgets, title)
  2977.                            *)
  2978.   screenHires     * = 9;  (* do not use lowres gadgets  (private) *)
  2979.  
  2980.   nsExtended      * = 12;         (* ExtNewScreen.Extension is valid      *)
  2981. (* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED       *)
  2982.  
  2983.   autoScroll      * = 14; (* screen is to autoscoll               *)
  2984.  
  2985. (* New for V39: *)
  2986.   penshared       * = 10;  (* Screen opener set {SA_SharePens,TRUE} *)
  2987.  
  2988.  
  2989.  
  2990.   stdScreenHeight * = -1; (* supply in NewScreen.height           *)
  2991.   stdScreenWidth  * = -1; (* supply in NewScreen.width            *)
  2992.  
  2993. (*
  2994.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  2995.  * TagItem arrays passed to OpenScreenTagList() (or in the
  2996.  * ExtNewScreen.Extension field).
  2997.  *)
  2998.  
  2999. (* Screen attribute tags.  Please use these versions, not those in
  3000.  * iobsolete.h.
  3001.  *)
  3002.  
  3003.   saDummy        * = u.user + 32;
  3004. (*
  3005.  * these items specify items equivalent to fields in NewScreen
  3006.  *)
  3007.   saLeft         * = saDummy + 00001H;
  3008.   saTop          * = saDummy + 00002H;
  3009.   saWidth        * = saDummy + 00003H;
  3010.   saHeight       * = saDummy + 00004H; (* traditional screen positions and dimensions  *)
  3011.   saDepth        * = saDummy + 00005H; (* screen bitmap depth                          *)
  3012.   saDetailPen    * = saDummy + 00006H; (* serves as default for windows, too           *)
  3013.   saBlockPen     * = saDummy + 00007H;
  3014.   saTitle        * = saDummy + 00008H; (* default screen title                         *)
  3015.   saColors       * = saDummy + 00009H;
  3016.                   (* ti_Data is an array of struct ColorSpec,
  3017.                    * terminated by ColorIndex = -1.  Specifies
  3018.                    * initial screen palette colors.
  3019.                    * Also see SA_Colors32 for use under V39.
  3020.                    *)
  3021.   saErrorCode    * = saDummy + 0000AH; (* ti_Data points to LONG error code (values below)*)
  3022.   saFont         * = saDummy + 0000BH; (* equiv. to NewScreen.Font                     *)
  3023.   saSysFont      * = saDummy + 0000CH;
  3024.                   (* Selects one of the preferences system fonts:
  3025.                    *      0 - old DefaultFont, fixed-width
  3026.                    *      1 - WB Screen preferred font
  3027.                    *)
  3028.   saType         * = saDummy + 0000DH;
  3029.                   (* ti_Data is PUBLICSCREEN or CUSTOMSCREEN.  For other
  3030.                    * fields of NewScreen.Type, see individual tags,
  3031.                    * eg. SA_Behind, SA_Quiet.
  3032.                    *)
  3033.   saBitMap       * = saDummy + 0000EH;
  3034.                   (* ti_Data is pointer to custom BitMap.  This
  3035.                    * implies type of CUSTOMBITMAP
  3036.                    *)
  3037.   saPubName      * = saDummy + 0000FH;
  3038.                   (* presence of this tag means that the screen
  3039.                    * is to be a public screen.  Please specify
  3040.                    * BEFORE the two tags below
  3041.                    *)
  3042.   saPubSig       * = saDummy + 00010H;
  3043.   saPubTask      * = saDummy + 00011H;
  3044.                   (* Task ID and signal for being notified that
  3045.                    * the last window has closed on a public screen.
  3046.                    *)
  3047.   saDisplayID    * = saDummy + 00012H;
  3048.                   (* ti_Data is new extended display ID from
  3049.                    * <graphics/displayinfo.h> (V37) or from
  3050.                    * <graphics/modeid.h> (V39 and up)
  3051.                    *)
  3052.   saDClip        * = saDummy + 00013H;
  3053.                   (* ti_Data points to a rectangle which defines
  3054.                    * screen display clip region
  3055.                    *)
  3056.   saOverscan     * = saDummy + 00014H;
  3057.                   (* Set to one of the oScan
  3058.                    * specifiers below to get a system standard
  3059.                    * overscan region for your display clip,
  3060.                    * screen dimensions (unless otherwise specified),
  3061.                    * and automatically centered position (partial
  3062.                    * support only so far).
  3063.                    * If you use this, you shouldn't specify
  3064.                    * saDClip.  saOverscan is for "standard"
  3065.                    * overscan dimensions, saDClip is for
  3066.                    * your custom numeric specifications.
  3067.                    *)
  3068.   saObsolete1    * = saDummy + 00015H; (* obsolete S_MONITORNAME *)
  3069.  
  3070. (** booleans **)
  3071.   saShowTitle    * = saDummy + 00016H; (* boolean equivalent to flag SHOWTITLE         *)
  3072.   saBehind       * = saDummy + 00017H; (* boolean equivalent to flag SCREENBEHIND      *)
  3073.   saQuiet        * = saDummy + 00018H; (* boolean equivalent to flag SCREENQUIET       *)
  3074.   saAutoScroll   * = saDummy + 00019H; (* boolean equivalent to flag AUTOSCROLL        *)
  3075.   saPens         * = saDummy + 0001AH;
  3076.                   (* pointer to ~0 terminated UWORD array, as
  3077.                    * found in struct DrawInfo
  3078.                    *)
  3079.   saFullPalette  * = saDummy + 0001BH;
  3080.                   (* boolean: initialize color table to entire
  3081.                    *  preferences palette (32 for V36), rather
  3082.                    * than compatible pens 0-3, 17-19, with
  3083.                    * remaining palette as returned by GetColorMap()
  3084.                    *)
  3085.   saColorMapEntries * = saDummy + 0001CH;
  3086.                       (* New for V39:
  3087.                        * Allows you to override the number of entries
  3088.                        * in the ColorMap for your screen.  Intuition
  3089.                        * normally allocates (1<<depth) or 32, whichever
  3090.                        * is more, but you may require even more if you
  3091.                        * use certain V39 graphics.library features
  3092.                        * (eg. palette-banking).
  3093.                        *)
  3094.  
  3095.   saParent       * = saDummy + 0001DH;
  3096.                       (* New for V39:
  3097.                        * ti_Data is a pointer to a "parent" screen to
  3098.                        * attach this one to.  Attached screens slide
  3099.                        * and depth-arrange together.
  3100.                        *)
  3101.  
  3102.   saDraggable    * = saDummy + 0001EH;
  3103.                       (* New for V39:
  3104.                        * Boolean tag allowing non-draggable screens.
  3105.                        * Do not use without good reason!
  3106.                        * (Defaults to TRUE).
  3107.                        *)
  3108.  
  3109.   saExclusive    * = saDummy + 0001FH;
  3110.                       (* New for V39:
  3111.                        * Boolean tag allowing screens that won't share
  3112.                        * the display.  Use sparingly!  Starting with 3.01,
  3113.                        * attached screens may be SA_Exclusive.  Setting
  3114.                        * SA_Exclusive for each screen will produce an
  3115.                        * exclusive family.   (Defaults to FALSE).
  3116.                        *)
  3117.  
  3118.   saSharePens    * = saDummy + 00020H;
  3119.                       (* New for V39:
  3120.                        * For those pens in the screen's DrawInfo->dri_Pens,
  3121.                        * Intuition obtains them in shared mode (see
  3122.                        * graphics.library/ObtainPen()).  For compatibility,
  3123.                        * Intuition obtains the other pens of a public
  3124.                        * screen as PEN_EXCLUSIVE.  Screens that wish to
  3125.                        * manage the pens themselves should generally set
  3126.                        * this tag to TRUE.  This instructs Intuition to
  3127.                        * leave the other pens unallocated.
  3128.                        *)
  3129.  
  3130.   saBackFill     * = saDummy + 00021H;
  3131.                       (* New for V39:
  3132.                        * provides a "backfill hook" for your screen's
  3133.                        * Layer_Info.
  3134.                        * See layers.library/InstallLayerInfoHook()
  3135.                        *)
  3136.  
  3137.   saInterleaved  * = saDummy + 00022H;
  3138.                       (* New for V39:
  3139.                        * Boolean tag requesting that the bitmap
  3140.                        * allocated for you be interleaved.
  3141.                        * (Defaults to FALSE).
  3142.                        *)
  3143.  
  3144.   saColors32     * = saDummy + 00023H;
  3145.                       (* New for V39:
  3146.                        * Tag to set the screen's initial palette colors
  3147.                        * at 32 bits-per-gun.  ti_Data is a pointer
  3148.                        * to a table to be passed to the
  3149.                        * graphics.library/LoadRGB32() function.
  3150.                        * This format supports both runs of color
  3151.                        * registers and sparse registers.  See the
  3152.                        * autodoc for that function for full details.
  3153.                        * Any color set here has precedence over
  3154.                        * the same register set by SA_Colors.
  3155.                        *)
  3156.  
  3157.   saVideoControl * = saDummy + 00024H;
  3158.                       (* New for V39:
  3159.                        * ti_Data is a pointer to a taglist that Intuition
  3160.                        * will pass to graphics.library/VideoControl(),
  3161.                        * upon opening the screen.
  3162.                        *)
  3163.  
  3164.   saFrontChild   * = saDummy + 00025H;
  3165.                       (* New for V39:
  3166.                        * ti_Data is a pointer to an already open screen
  3167.                        * that is to be the child of the screen being
  3168.                        * opened.  The child screen will be moved to the
  3169.                        * front of its family.
  3170.                        *)
  3171.  
  3172.   saBackChild    * = saDummy + 00026H;
  3173.                       (* New for V39:
  3174.                        * ti_Data is a pointer to an already open screen
  3175.                        * that is to be the child of the screen being
  3176.                        * opened.  The child screen will be moved to the
  3177.                        * back of its family.
  3178.                        *)
  3179.  
  3180.   saLikeWorkbench * = saDummy + 00027H;
  3181.                       (* New for V39:
  3182.                        * Set ti_Data to 1 to request a screen which
  3183.                        * is just like the Workbench.  This gives
  3184.                        * you the same screen mode, depth, size,
  3185.                        * colors, etc., as the Workbench screen.
  3186.                        *)
  3187.  
  3188.   saReserved       = saDummy + 00028H;
  3189.                       (* Reserved for private Intuition use *)
  3190.  
  3191.   saMinimizeISG * =  saDummy + 00029H;
  3192.                         (* New for V40:
  3193.                          * For compatibility, Intuition always ensures
  3194.                          * that the inter-screen gap is at least three
  3195.                          * non-interlaced lines.  If your application
  3196.                          * would look best with the smallest possible
  3197.                          * inter-screen gap, set ti_Data to TRUE.
  3198.                          * If you use the new graphics VideoControl()
  3199.                          * VC_NoColorPaletteLoad tag for your screen's
  3200.                          * ViewPort, you should also set this tag.
  3201.                          *)
  3202.  
  3203.  
  3204. (* OpenScreen error codes, which are returned in the (optional) LONG
  3205.  * pointed to by ti_Data for the saErrorCode tag item
  3206.  *)
  3207.   osErrNoMonitor * = 1;     (* named monitor spec not available     *)
  3208.   osErrNoChips   * = 2;     (* you need newer custom chips          *)
  3209.   osErrNoMem     * = 3;     (* couldn't get normal memory           *)
  3210.   osErrNoChipMem * = 4;     (* couldn't get chipmem                 *)
  3211.   osErrPubNotUnique * = 5;  (* public screen name already used      *)
  3212.   osErrUnknownMode  * = 6;  (* don't recognize mode asked for       *)
  3213.   oserrTooDeep      * = 7;  (* Screen deeper than HW supports       *)
  3214.   oserrAttachFail   * = 8;  (* Failed to attach screens             *)
  3215.   oserrNotAvailable * = 9;  (* Mode not available for other reason  *)
  3216.  
  3217.  
  3218. TYPE
  3219. (* ======================================================================== *)
  3220. (* === NewScreen ========================================================== *)
  3221. (* ======================================================================== *)
  3222. (* note: to use the Extended field, you must use the
  3223.  * new ExtNewScreen structure, below
  3224.  *)
  3225.   NewScreen * = STRUCT
  3226.  
  3227.     leftEdge * , topEdge * , width * , height * , depth * : INTEGER;  (* screen dimensions *)
  3228.  
  3229.     detailPen * , blockPen * : SHORTINT; (* for bar/border/gadget rendering      *)
  3230.  
  3231.     viewModes * : SET;                   (* the Modes for the ViewPort (and View) *)
  3232.  
  3233.     type * : SET;                        (* the Screen type (see defines above)  *)
  3234.  
  3235.     font * : g.TextAttrPtr;              (* this Screen's default text attributes *)
  3236.  
  3237.     defaultTitle * : e.LSTRPTR;          (* the default title for this Screen    *)
  3238.  
  3239.     gadgets * : GadgetDummyPtr;          (* UNUSED:  Leave this NULL             *)
  3240.  
  3241.     (* if you are opening a CUSTOMSCREEN and already have a BitMap
  3242.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  3243.      * the Type field and you set this variable to point to your BitMap
  3244.      * structure.  The structure will be copied into your Screen structure,
  3245.      * after which you may discard your own BitMap if you want
  3246.      *)
  3247.     customBitMap * : g.BitMapPtr;
  3248.  
  3249.   END;
  3250.  
  3251. (*
  3252.  * For compatibility reasons, we need a new structure for extending
  3253.  * NewScreen.  Use this structure is you need to use the new Extension
  3254.  * field.
  3255.  *
  3256.  * NOTE: V36-specific applications should use the
  3257.  * OpenScreenTagList( newscreen, tags ) version of OpenScreen().
  3258.  * Applications that want to be V34-compatible as well may safely use the
  3259.  * ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
  3260.  *
  3261.  *)
  3262.   ExtNewScreen * = STRUCT (ns * : NewScreen)
  3263.  
  3264.     extension * : u.TagListPtr; (* more specification data, scanned if
  3265.                                  * NS_EXTENDED is set in NewScreen.Type
  3266.                                  *)
  3267.   END;
  3268.  
  3269. CONST
  3270.  
  3271. (* === Overscan Types ===       *)
  3272.   oScanText      * = 1;     (* entirely visible     *)
  3273.   oScanStandard  * = 2;     (* just past edges      *)
  3274.   oScanMax       * = 3;     (* as much as possible  *)
  3275.   oScanVideo     * = 4;     (* even more than is possible   *)
  3276.  
  3277.  
  3278. TYPE
  3279.  
  3280. (* === Public Shared Screen Node ===    *)
  3281.  
  3282. (* This is the representative of a public shared screen.
  3283.  * This is an internal data structure, but some functions may
  3284.  * present a copy of it to the calling application.  In that case,
  3285.  * be aware that the screen pointer of the structure can NOT be
  3286.  * used safely, since there is no guarantee that the referenced
  3287.  * screen will remain open and a valid data structure.
  3288.  *
  3289.  * Never change one of these.
  3290.  *)
  3291.  
  3292.   PubScreenNode * = STRUCT (node * : e.Node) (* ln_Name is screen name *)
  3293.     screen * : ScreenPtr;
  3294.     flags * : SET;            (* see below            *)
  3295.     size * : INTEGER;         (* includes name buffer *)
  3296.     visitorCount * : INTEGER; (* how many visitor windows *)
  3297.     sigTask * : e.TaskPtr;    (* who to signal when visitors gone *)
  3298.     sigBit * : SHORTINT;      (* which signal *)
  3299.   END;
  3300.  
  3301. CONST
  3302.   psnfPrivate * = 0;
  3303.  
  3304.   maxPubScreenName * = 139;   (* names no longer, please      *)
  3305.  
  3306. (* pub screen modes     *)
  3307.   shanghai      * = 0;  (* put workbench windows on pub screen *)
  3308.   popPubScreen  * = 1;  (* pop pub screen to front when visitor opens *)
  3309.  
  3310. (* New for V39:  Intuition has new screen depth-arrangement and movement
  3311.  * functions called ScreenDepth() and ScreenPosition() respectively.
  3312.  * These functions permit the old behavior of ScreenToFront(),
  3313.  * ScreenToBack(), and MoveScreen().  ScreenDepth() also allows
  3314.  * independent depth control of attached screens.  ScreenPosition()
  3315.  * optionally allows positioning screens even though they were opened
  3316.  * {SA_Draggable,FALSE}.
  3317.  *)
  3318.  
  3319. (* For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  3320.  * and optionally also SDEPTH_INFAMILY.
  3321.  *
  3322.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3323.  * SDEPTH_INFAMILY.  Commodities, "input helper" programs,
  3324.  * or any other program that did not open a screen should never
  3325.  * use that flag.  (Note that this is a style-behavior
  3326.  * requirement;  there is no technical requirement that the
  3327.  * task calling this function need be the task which opened
  3328.  * the screen).
  3329.  *)
  3330.  
  3331.   sdepthToFront  * = LONGSET{};     (* Bring screen to front *)
  3332.   sdepthToBack   * = LONGSET{0};    (* Send screen to back *)
  3333.   sdepthInFamily * = LONGSET{1};    (* Move an attached screen with
  3334.                              * respect to other screens of its family
  3335.                              *)
  3336.  
  3337. (* Here's an obsolete name equivalent to SDEPTH_INFAMILY: *)
  3338.   sdepthChildOnly * = sdepthInFamily;
  3339.  
  3340.  
  3341. (* For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  3342.  * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  3343.  * wish to perform:
  3344.  *
  3345.  * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  3346.  *    the offset in coordinates you wish to move the screen by.
  3347.  * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  3348.  *    the absolute coordinates you wish to move the screen to.
  3349.  * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  3350.  *    screen which you would like autoscrolled into view.
  3351.  *
  3352.  * You may additionally set SPOS_FORCEDRAG along with any of the
  3353.  * above.  Set this if you wish to reposition an {SA_Draggable,FALSE}
  3354.  * screen that you opened.
  3355.  *
  3356.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3357.  * SPOS_FORCEDRAG.  Commodities, "input helper" programs,
  3358.  * or any other program that did not open a screen should never
  3359.  * use that flag.
  3360.  *)
  3361.  
  3362.   sposRelative   * = LONGSET{};   (* Coordinates are relative *)
  3363.  
  3364.   sposAbsolute   * = LONGSET{0};  (* Coordinates are expressed as
  3365.                                    * absolutes, not relatives.
  3366.                                    *)
  3367.  
  3368.   sposMakeVisible * = LONGSET{1}; (* Coordinates describe a box on
  3369.                                    * the screen you wish to be
  3370.                                    * made visible by autoscrolling
  3371.                                    *)
  3372.  
  3373.   sposForceDrag  * = LONGSET{2};  (* Move non-draggable screen *)
  3374.  
  3375.  
  3376. TYPE
  3377. (* New for V39: Intuition supports double-buffering in screens,
  3378.  * with friendly interaction with menus and certain gadgets.
  3379.  * For each buffer, you need to get one of these structures
  3380.  * from the AllocScreenBuffer() call.  Never allocate your
  3381.  * own ScreenBuffer structures!
  3382.  *
  3383.  * The sb_DBufInfo field is for your use.  See the graphics.library
  3384.  * AllocDBufInfo() autodoc for details.
  3385.  *)
  3386.   ScreenBuffer * = STRUCT
  3387.      bitMap * : g.BitMapPtr;         (* BitMap of this buffer *)
  3388.     dBufInfo *: g.DBufInfoPtr;     (* DBufInfo for this buffer *)
  3389.   END;
  3390.  
  3391. CONST
  3392. (* These are the flags that may be passed to AllocScreenBuffer().
  3393.  *)
  3394.   sbScreenBitMap * = 0;
  3395.   sbCopyBitMap   * = 1;
  3396.  
  3397. TYPE
  3398.  
  3399.   StringExtend * = STRUCT
  3400.     (* display specifications   *)
  3401.     font * : g.TextFontPtr;              (* must be an open Font (not TextAttr)  *)
  3402.     pens * : ARRAY 2 OF SHORTINT;        (* color of text/background             *)
  3403.     activePens * : ARRAY 2 OF SHORTINT;  (* colors when gadget is active         *)
  3404.  
  3405.     (* edit specifications      *)
  3406.     initialMode * : LONGSET;             (* inital mode flags, below             *)
  3407.     editHook * : u.HookPtr;              (* if non-NULL, must supply WorkBuffer  *)
  3408.     workBuffer * : e.APTR;               (* must be as large as StringInfo.Buffer*)
  3409.  
  3410.     reserved * : ARRAY 4 OF LONGINT;     (* set to 0                             *)
  3411.   END;
  3412.  
  3413.   SGWork * = STRUCT
  3414.     (* set up when gadget is first activated    *)
  3415.     gadget * : GadgetDummyPtr;     (* the contestant itself        *)
  3416.     stringInfo * : StringInfoPtr;  (* easy access to sinfo         *)
  3417.     workBuffer * : e.APTR;         (* intuition's planned result   *)
  3418.     prevBuffer * : e.APTR;         (* what was there before        *)
  3419.     modes * : LONGSET;             (* current mode                 *)
  3420.  
  3421.     (* modified for each input event    *)
  3422.     iEvent * : ie.InputEventDummyPtr;(* actual event: do not change*)
  3423.     code * : INTEGER;              (* character code, if one byte  *)
  3424.     bufferPos * : INTEGER;         (* cursor position              *)
  3425.     numChars * : INTEGER;
  3426.     actions * : LONGSET;           (* what Intuition will do       *)
  3427.     longInt * : LONGINT;           (* temp storage for longint     *)
  3428.  
  3429.     gadgetInfo * : GadgetInfoPtr;  (* see cghooks.h                *)
  3430.     editOp * : INTEGER;            (* from constants below         *)
  3431.   END;
  3432.  
  3433. CONST
  3434.  
  3435. (* SGWork.editOp -
  3436.  * These values indicate what basic type of operation the global
  3437.  * editing hook has performed on the string before your gadget's custom
  3438.  * editing hook gets called.  You do not have to be concerned with the
  3439.  * value your custom hook leaves in the EditOp field, only if you
  3440.  * write a global editing hook.
  3441.  *
  3442.  * For most of these general edit operations, you'll want to compare
  3443.  * the BufferPos and NumChars of the StringInfo (before global editing)
  3444.  * and SGWork (after global editing).
  3445.  *)
  3446.  
  3447.   eoNoOp        * = 01H; (* did nothing                                                  *)
  3448.   eoDelBackward * = 02H; (* deleted some chars (maybe 0).                                *)
  3449.   eoDelForward  * = 03H; (* deleted some characters under and in front of the cursor     *)
  3450.   eoMoveCursor  * = 04H; (* moved the cursor                                             *)
  3451.   eoEnter       * = 05H; (* "enter" or "return" key, terminate                           *)
  3452.   eoReset       * = 06H; (* current Intuition-style undo                                 *)
  3453.   eoReplaceChar * = 07H; (* replaced one character and (maybe) advanced cursor           *)
  3454.   eoInsertChar  * = 08H; (* inserted one char into string or added one at end            *)
  3455.   eoBadFormat   * = 09H; (* didn't like the text data, e.g., Bad LONGINT                 *)
  3456.   eoBigChange   * = 0AH; (* complete or major change to the text, e.g. new string        *) (* unused by Intuition  *)
  3457.   eoUndo        * = 0BH; (* some other style of undo                                     *) (* unused by Intuition  *)
  3458.   eoClear       * = 0CH; (* clear the string                                             *)
  3459.   eoSpecial     * = 0DH; (* some operation that doesn't fit into the categories here     *) (* unused by Intuition  *)
  3460.  
  3461.  
  3462. (* Mode Flags definitions (ONLY first group allowed as InitialModes)    *)
  3463.   sgmReplace     * = 0;          (* replace mode                 *)
  3464. (* please initialize StringInfo with in-range value of BufferPos
  3465.  * if you are using sgmREPLACE mode.
  3466.  *)
  3467.  
  3468.   sgmFixedField  * = 1;          (* fixed length buffer          *)
  3469.                                  (* always set sgmREPLACE, too  *)
  3470.   sgmNoFilter    * = 2;          (* don't filter control chars   *)
  3471.  
  3472. (* SGM_EXITHELP is new for V37, and ignored by V36: *)
  3473.   sgmExitHelp    * = 7;          (* exit with code = 0x5F if HELP hit *)
  3474.  
  3475.  
  3476. (* These Mode Flags are for internal use only                           *)
  3477.   sgmNoChange    * = 3;          (* no edit changes yet          *)
  3478.   sgmNoWorkB     * = 4;          (* Buffer == PrevBuffer         *)
  3479.   sgmControl     * = 5;          (* control char escape mode     *)
  3480.   sgmLongint     * = 6;          (* an intuition longint gadget  *)
  3481.  
  3482. (* String Gadget Action Flags (put in SGWork.Actions by EditHook)       *)
  3483.   sgaUse         * = 0;  (* use contents of SGWork               *)
  3484.   sgaEnd         * = 1;  (* terminate gadget, code in Code field *)
  3485.   sgaBeep        * = 2;  (* flash the screen for the user        *)
  3486.   sgaReuse       * = 3;  (* reuse input event                    *)
  3487.   sgaRedisplay   * = 4;  (* gadget visuals changed               *)
  3488.  
  3489. (* New for V37: *)
  3490.   sgaNextActive  * = 5;  (* Make next possible gadget active.    *)
  3491.   sgaPrevActive  * = 6;  (* Make previous possible gadget active.*)
  3492.  
  3493. (* function id for only existing custom string gadget edit hook *)
  3494.  
  3495.   sghKey         * = 1;  (* process editing keystroke            *)
  3496.   sghClick       * = 2;  (* process mouse click cursor position  *)
  3497.  
  3498. (* Here's a brief summary of how the custom string gadget edit hook works:
  3499.  *    You provide a hook in StringInfo.Extension.EditHook.
  3500.  *    The hook is called in the standard way with the 'object'
  3501.  *    a pointer to SGWork, and the 'message' a pointer to a command
  3502.  *    block, starting either with (longword) sghKEY, sghCLICK,
  3503.  *    or something new.
  3504.  *
  3505.  *    You return 0 if you don't understand the command (sghKEY is
  3506.  *    required and assumed).  Return non-zero if you implement the
  3507.  *    command.
  3508.  *
  3509.  * sghKEY:
  3510.  *
  3511.  *    There are no parameters following the command longword.
  3512.  *
  3513.  *    Intuition will put its idea of proper values in the SGWork
  3514.  *    before calling you, and if you leave sgaUSE set in the
  3515.  *    SGWork.Actions field, Intuition will use the values
  3516.  *    found in SGWork fields WorkBuffer, NumChars, BufferPos,
  3517.  *    and LongInt, copying the WorkBuffer back to the StringInfo
  3518.  *    Buffer.
  3519.  *
  3520.  *    NOTE WELL: You may NOT change other SGWork fields.
  3521.  *
  3522.  *    If you clear sgaUSE, the string gadget will be unchanged.
  3523.  *
  3524.  *    If you set sgaEND, Intuition will terminate the activation
  3525.  *    of the string gadget.  If you also set sgaREUSE, Intuition
  3526.  *    will reuse the input event after it deactivates your gadget.
  3527.  *
  3528.  *    In this case, Intuition will put the value found in SGWork.Code
  3529.  *    into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  3530.  *    sends to the application.
  3531.  *
  3532.  *    If you set sgaBEEP, Intuition will call DisplayBeep(); use
  3533.  *    this if the user has typed in error, or buffer is full.
  3534.  *
  3535.  *    Set sgaREDISPLAY if the changes to the gadget warrant a
  3536.  *    gadget redisplay.  Note: cursor movement requires a redisplay.
  3537.  *
  3538.  *    Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  3539.  *    when you set SGA_END.  This tells Intuition that you want
  3540.  *    the next or previous gadget with GFLG_TABCYCLE to be activated.
  3541.  *
  3542.  * sghCLICK:
  3543.  *    This hook command is called when Intuition wants to position
  3544.  *    the cursor in response to a mouse click in the string gadget.
  3545.  *
  3546.  *    Again, here are no parameters following the command longword.
  3547.  *
  3548.  *    This time, Intuition has already calculated the mouse position
  3549.  *    character cell and put it in SGWork.BufferPos.  The previous
  3550.  *    BufferPos value remains in the SGWork.StringInfo.BufferPos.
  3551.  *
  3552.  *    Intuition will again use the SGWork fields listed above for
  3553.  *    sghKEY.  One restriction is that you are NOT allowed to set
  3554.  *    sgaEND or sgaREUSE for this command.  Intuition will not
  3555.  *    stand for a gadget which goes inactive when you click in it.
  3556.  *
  3557.  *    You should always leave the sgaREDISPLAY flag set, since Intuition
  3558.  *    uses this processing when activating a string gadget.
  3559.  *)
  3560.  
  3561. (* IntuitionBase: *)
  3562.  
  3563. (* these are the display modes for which we have corresponding parameter
  3564.  *  settings in the config arrays
  3565.  *)
  3566.   dModeCount    * = 2;    (* how many modes there are *)
  3567.   hiresPick     * = 0;
  3568.   lowresPick    * = 1;
  3569.  
  3570.   eventMax * = 10;        (* size of event array *)
  3571.  
  3572. (* these are the system Gadget defines *)
  3573.   resCount      * = 2;
  3574.   hiresGadget   * = 0;
  3575.   lowresGadget  * = 1;
  3576.  
  3577.   gadgetCount     * = 8;
  3578.   upFrontGadget   * = 0;
  3579.   downBackGadget  * = 1;
  3580.   sizeGadget      * = 2;
  3581.   closeGadget     * = 3;
  3582.   dragGadget      * = 4;
  3583.   sUpFrontGadget  * = 5;
  3584.   sDownBackGadget * = 6;
  3585.   sDragGadget     * = 7;
  3586.  
  3587.  
  3588. (* ======================================================================== *)
  3589. (* === IntuitionBase ====================================================== *)
  3590. (* ======================================================================== *)
  3591. (*
  3592.  * Be sure to protect yourself against someone modifying these data as
  3593.  * you look at them.  This is done by calling:
  3594.  *
  3595.  * lock = LockIBase(0), which returns a ULONG.  When done call
  3596.  * UnlockIBase(lock) where lock is what LockIBase() returned.
  3597.  *)
  3598.  
  3599. TYPE
  3600.  
  3601. (* This structure is strictly READ ONLY *)
  3602.   IntuitionBase * = STRUCT (libNode - : e.Library)
  3603.  
  3604.     viewLord - : g.View;
  3605.  
  3606.     activeWindow - : WindowPtr;
  3607.     activeScreen - : ScreenPtr;
  3608.  
  3609.     (* the FirstScreen variable points to the frontmost Screen.  Screens are
  3610.      * then maintained in a front to back order using Screen.NextScreen
  3611.      *)
  3612.     firstScreen - : ScreenPtr; (* for linked list of all screens *)
  3613.  
  3614.     flags   : LONGSET;         (* values are all system private *)
  3615.     mouseY - , mouseX - : INTEGER;
  3616.                                (* note "backwards" order of these              *)
  3617.  
  3618.     time - : t.TimeVal         (* timestamp of most current input event *)
  3619.  
  3620.     (* I told you this was private.
  3621.      * The data beyond this point has changed, is changing, and
  3622.      * will continue to change.
  3623.      *)
  3624.  
  3625.   END;
  3626.  
  3627. (* Boolean Parameters must be 4 Bytes long: *)
  3628.  
  3629. TYPE
  3630.   LONGBOOL * = e.LONGBOOL;
  3631.  
  3632. CONST
  3633.   LTRUE  * = e.LTRUE;
  3634.   LFALSE * = e.LFALSE;
  3635.  
  3636.  
  3637. VAR
  3638.  int *, base * : IntuitionBasePtr;
  3639.  
  3640.  
  3641. PROCEDURE OpenIntuition  *{int,- 30}();
  3642. PROCEDURE Intuition      *{int,- 36}(iEvent{8}        : ie.InputEventDummyPtr);
  3643. PROCEDURE AddGadget      *{int,- 42}(window{8}        : WindowPtr;
  3644.                                      VAR gadget{9}    : Gadget;
  3645.                                      position{0}      : LONGINT): INTEGER;
  3646. PROCEDURE ClearDMRequest *{int,- 48}(window{8}        : WindowPtr): BOOLEAN;
  3647. PROCEDURE ClearMenuStrip *{int,- 54}(window{8}        : WindowPtr);
  3648. PROCEDURE ClearPointer   *{int,- 60}(window{8}        : WindowPtr);
  3649. PROCEDURE CloseScreen    *{int,- 66}(screen{8}        : ScreenPtr): BOOLEAN;
  3650. PROCEDURE OldCloseScreen *{int,- 66}(screen{8}        : ScreenPtr); (* version<36 had no result *)
  3651. PROCEDURE CloseWindow    *{int,- 72}(window{8}        : WindowPtr);
  3652. PROCEDURE CloseWorkBench *{int,- 78}(): BOOLEAN;
  3653. PROCEDURE CurrentTime    *{int,- 84}(VAR seconds{8}   : LONGINT;
  3654.                                      VAR micros{9}    : LONGINT);
  3655. PROCEDURE DisplayAlert   *{int,- 90}(alertNumber{0}   : LONGINT;
  3656.                                      string{8}        : ARRAY OF CHAR;
  3657.                                      height{1}        : LONGINT): BOOLEAN;
  3658. PROCEDURE DisplayBeep    *{int,- 96}(screen{8}        : ScreenPtr);
  3659. PROCEDURE DoubleClick    *{int,-102}(sSeconds{0}      : LONGINT;
  3660.                                      sMicros{1}       : LONGINT;
  3661.                                      cSeconds{2}      : LONGINT;
  3662.                                      cMicros{3}       : LONGINT): BOOLEAN;
  3663. PROCEDURE DrawBorder     *{int,-108}(rp{8}            : g.RastPortPtr;
  3664.                                      border{9}        : BorderPtr;
  3665.                                      leftOffset{0}    : LONGINT;
  3666.                                      topOffset{1}     : LONGINT);
  3667. PROCEDURE DrawImage      *{int,-114}(rp{8}            : g.RastPortPtr;
  3668.                                      image{9}         : Image;
  3669.                                      leftOffset{0}    : LONGINT;
  3670.                                      topOffset{1}     : LONGINT);
  3671. PROCEDURE EndRequest     *{int,-120}(requester{8}     : RequesterPtr;
  3672.                                      window{9}        : WindowPtr);
  3673. PROCEDURE GetDefPrefs    *{int,-126}(VAR preferences{8} : ARRAY OF e.BYTE;
  3674.                                      size{0}          : LONGINT);
  3675. PROCEDURE GetPrefs       *{int,-132}(VAR preferences{8} : ARRAY OF e.BYTE;
  3676.                                      size{0}          : LONGINT);
  3677. PROCEDURE InitRequester  *{int,-138}(VAR requester{8} : Requester);
  3678. PROCEDURE ItemAddress    *{int,-144}(menuStrip{8}     : Menu;
  3679.                                      menuNumber{0}    : LONGINT):  MenuItemPtr;
  3680. PROCEDURE ModifyIDCMP    *{int,-150}(window{8}        : WindowPtr;
  3681.                                      flags{0}         : LONGSET): BOOLEAN;
  3682. PROCEDURE OldModifyIDCMP *{int,-150}(window{8}        : WindowPtr;
  3683.                                      flags{0}         : LONGSET);
  3684. PROCEDURE ModifyProp     *{int,-156}(VAR gadget{8}    : Gadget;
  3685.                                      window{9}        : WindowPtr;
  3686.                                      requester{10}    : RequesterPtr;
  3687.                                      flags{0}         : SET;
  3688.                                      horizPot{1}      : LONGINT;
  3689.                                      vertPot{2}       : LONGINT;
  3690.                                      horizBody{3}     : LONGINT;
  3691.                                      vertBody{4}      : LONGINT);
  3692. PROCEDURE MoveScreen     *{int,-162}(screen{8}        : ScreenPtr;
  3693.                                      dx{0}            : LONGINT;
  3694.                                      dy{1}            : LONGINT);
  3695. PROCEDURE MoveWindow     *{int,-168}(window{8}        : WindowPtr;
  3696.                                      dx{0}            : LONGINT;
  3697.                                      dy{1}            : LONGINT);
  3698. PROCEDURE OffGadget      *{int,-174}(VAR gadget{8}    : Gadget;
  3699.                                      window{9}        : WindowPtr;
  3700.                                      requester{10}    : RequesterPtr);
  3701. PROCEDURE OffMenu        *{int,-180}(window{8}        : WindowPtr;
  3702.                                      menuNumber{0}    : LONGINT);
  3703. PROCEDURE OnGadget       *{int,-186}(VAR gadget{8}    : Gadget;
  3704.                                      window{9}        : WindowPtr;
  3705.                                      requester{10}    : RequesterPtr);
  3706. PROCEDURE OnMenu         *{int,-192}(window{8}        : WindowPtr;
  3707.                                      menuNumber{0}    : LONGINT);
  3708. PROCEDURE OpenScreen     *{int,-198}(newScreen{8}     : NewScreen): ScreenPtr;
  3709. PROCEDURE OpenWindow     *{int,-204}(newWindow{8}     : NewWindow ): WindowPtr;
  3710. PROCEDURE OpenWorkBench  *{int,-210}(): ScreenPtr;
  3711. PROCEDURE PrintIText     *{int,-216}(rp{8}            : g.RastPortPtr;
  3712.                                      iText{9}         : IntuiText;
  3713.                                      left{0}          : LONGINT;
  3714.                                      top{1}           : LONGINT);
  3715. PROCEDURE RefreshGadgets *{int,-222}(gadgets{8}       : GadgetDummyPtr;
  3716.                                      window{9}        : WindowPtr;
  3717.                                      requester{10}    : RequesterPtr);
  3718. PROCEDURE RemoveGadget   *{int,-228}(window{8}        : WindowPtr;
  3719.                                      VAR gadget{9}    : Gadget): INTEGER;
  3720. PROCEDURE ReportMouse    *{int,-234}(window{8}        : WindowPtr;
  3721.                                      flag{0}          : LONGBOOL);
  3722. PROCEDURE Request        *{int,-240}(requester{8}     : RequesterPtr;
  3723.                                      window{9}        : WindowPtr ): BOOLEAN;
  3724. PROCEDURE ScreenToBack   *{int,-246}(screen{8}        : ScreenPtr);
  3725. PROCEDURE ScreenToFront  *{int,-252}(screen{8}        : ScreenPtr);
  3726. PROCEDURE SetDMRequest   *{int,-258}(window{8}        : WindowPtr;
  3727.                                      requester{9}     : RequesterPtr): BOOLEAN;
  3728. PROCEDURE SetMenuStrip   *{int,-264}(window{8}        : WindowPtr;
  3729.                                      VAR menu{9}      : Menu): BOOLEAN;
  3730. PROCEDURE SetPointer     *{int,-270}(window{8}        : WindowPtr;
  3731.                                      pointer{9}       : ARRAY OF e.BYTE;
  3732.                                      height{0}        : LONGINT;
  3733.                                      width{1}         : LONGINT;
  3734.                                      xOffset{2}       : LONGINT;
  3735.                                      yOffset{3}       : LONGINT);
  3736. PROCEDURE SetWindowTitles*{int,-276}(window{8}        : WindowPtr;
  3737.                                      windowTitle{9}   : e.ADDRESS;
  3738.                                      screenTitle{10}  : e.ADDRESS);
  3739. PROCEDURE SetWindowTitlesStr*{int,-276}(window{8}        : WindowPtr;
  3740.                                      windowTitle{9}   : ARRAY OF CHAR;
  3741.                                      screenTitle{10}  : ARRAY OF CHAR);
  3742. PROCEDURE ShowTitle      *{int,-282}(screen{8}        : ScreenPtr;
  3743.                                      showIt{0}        : LONGBOOL);
  3744. PROCEDURE SizeWindow     *{int,-288}(window{8}        : WindowPtr;
  3745.                                      dx{0}            : LONGINT;
  3746.                                      dy{1}            : LONGINT);
  3747. PROCEDURE ViewAddress    *{int,-294}(): g.ViewPtr;
  3748. PROCEDURE ViewPortAddress*{int,-300}(window{8}        : WindowPtr): g.ViewPortPtr;
  3749. PROCEDURE WindowToBack   *{int,-306}(window{8}        : WindowPtr);
  3750. PROCEDURE WindowToFront  *{int,-312}(window{8}        : WindowPtr);
  3751. PROCEDURE WindowLimits   *{int,-318}(window{8}        : WindowPtr;
  3752.                                      widthMin{0}      : LONGINT;
  3753.                                      heightMin{1}     : LONGINT;
  3754.                                      widthMax{2}      : LONGINT;
  3755.                                      heightMax{3}     : LONGINT): BOOLEAN;
  3756. (*--- start of next generation of names -------------------------------------*)
  3757. PROCEDURE SetPrefs       *{int,-324}(preferences{8}   : ARRAY OF e.BYTE;
  3758.                                      size{0}          : LONGINT;
  3759.                                      inform{1}        : LONGBOOL);
  3760. (*--- start of next next generation of names --------------------------------*)
  3761. PROCEDURE IntuiTextLength*{int,-330}(iText{8}         : IntuiText): INTEGER;
  3762. PROCEDURE WBenchToBack   *{int,-336}(): BOOLEAN;
  3763. PROCEDURE WBenchToFront  *{int,-342}(): BOOLEAN;
  3764. (*--- start of next next next generation of names ---------------------------*)
  3765. PROCEDURE AutoRequest    *{int,-348}(window{8}        : WindowPtr;
  3766.                                      body{9}          : IntuiTextPtr;
  3767.                                      posText{10}      : IntuiTextPtr;
  3768.                                      negText{11}      : IntuiTextPtr;
  3769.                                      pFlag{0}         : LONGSET;
  3770.                                      nFlag{1}         : LONGSET;
  3771.                                      width{2}         : LONGINT;
  3772.                                      height{3}        : LONGINT): BOOLEAN;
  3773. PROCEDURE BeginRefresh   *{int,-354}(window{8}        : WindowPtr);
  3774. PROCEDURE BuildSysRequest*{int,-360}(window{8}        : WindowPtr;
  3775.                                      body{9}          : IntuiTextPtr;
  3776.                                      posText{10}      : IntuiTextPtr;
  3777.                                      negText{11}      : IntuiTextPtr;
  3778.                                      flags{0}         : LONGSET;
  3779.                                      width{1}         : LONGINT;
  3780.                                      height{2}        : LONGINT): WindowPtr;
  3781. PROCEDURE EndRefresh     *{int,-366}(window{8}        : WindowPtr;
  3782.                                      complete{0}      : LONGBOOL);
  3783. PROCEDURE FreeSysRequest *{int,-372}(window{8}        : WindowPtr);
  3784. PROCEDURE OldMakeScreen     *{int,-378}(screen{8}        : ScreenPtr);
  3785. PROCEDURE OldRemakeDisplay  *{int,-384}();
  3786. PROCEDURE OldRethinkDisplay *{int,-390}();
  3787. (* The return codes for MakeScreen(), RemakeDisplay(), and RethinkDisplay() *)
  3788. (* are only valid under V39 and greater.  Do not examine them when running *)
  3789. (* on pre-V39 systems! *)
  3790. PROCEDURE MakeScreen     *{int,-378}(screen{8}        : ScreenPtr): LONGINT;
  3791. PROCEDURE RemakeDisplay  *{int,-384}(): LONGINT;
  3792. PROCEDURE RethinkDisplay *{int,-390}(): LONGINT;
  3793. (*--- start of next next next next generation of names ----------------------*)
  3794. PROCEDURE AllocRemember  *{int,-396}(VAR rememberKey{8} : RememberPtr;
  3795.                                      size{0}          : LONGINT;
  3796.                                      flags{1}         : LONGSET): e.APTR;
  3797. PROCEDURE AlohaWorkbench *{int,-402}(wbport{8}        : e.MsgPortPtr);
  3798. PROCEDURE FreeRemember   *{int,-408}(VAR rememberKey{8} : RememberPtr;
  3799.                                      reallyForget{0}  : LONGBOOL);
  3800. (*--- start of 15 Nov 85 names ------------------------*)
  3801. PROCEDURE LockIBase      *{int,-414}(dontknow{0}      : LONGINT): LONGINT;
  3802. PROCEDURE UnlockIBase    *{int,-420}(ibLock{8}        : LONGINT);
  3803. (*--- functions in V33 or higher (Release 1.2) ---*)
  3804. PROCEDURE GetScreenData  *{int,-426}(VAR buffer{8}    : Screen;
  3805.                                      size{0}          : LONGINT;
  3806.                                      type{1}          : SET;
  3807.                                      screen{9}        : ScreenPtr): BOOLEAN;
  3808. PROCEDURE RefreshGList   *{int,-432}(gadgets{8}       : GadgetDummyPtr;
  3809.                                      window{9}        : WindowPtr;
  3810.                                      requester{10}    : RequesterPtr;
  3811.                                      numGad{0}        : LONGINT);
  3812. PROCEDURE AddGList       *{int,-438}(window{8}        : WindowPtr;
  3813.                                      gadget{9}        : GadgetDummyPtr;
  3814.                                      position{0}      : LONGINT;
  3815.                                      numGad{1}        : LONGINT;
  3816.                                      requester{10}    : RequesterPtr): INTEGER;
  3817. PROCEDURE RemoveGList    *{int,-444}(remPtr{8}        : WindowPtr;
  3818.                                      gadget{9}        : GadgetDummyPtr;
  3819.                                      numGad{0}        : LONGINT): INTEGER;
  3820. PROCEDURE ActivateWindow *{int,-450}(window{8}        : WindowPtr); (* no result, even for V36+ *)
  3821. PROCEDURE RefreshWindowFrame*{int,-456}(window{8}     : WindowPtr);
  3822. PROCEDURE ActivateGadget *{int,-462}(VAR gadget{8}    : Gadget;
  3823.                                      window{9}        : WindowPtr;
  3824.                                      requester{10}    : RequesterPtr): BOOLEAN;
  3825. PROCEDURE NewModifyProp  *{int,-468}(VAR gadget{8}    : Gadget;
  3826.                                      window{9}        : WindowPtr;
  3827.                                      requester{10}    : RequesterPtr;
  3828.                                      flags{0}         : SET;
  3829.                                      horizPot{1}      : LONGINT;
  3830.                                      vertPot{2}       : LONGINT;
  3831.                                      horizBody{3}     : LONGINT;
  3832.                                      vertBody{4}      : LONGINT;
  3833.                                      numGad{5}        : LONGINT);
  3834. (*--- functions in V36 or higher (Release 2.0) ---*)
  3835. (*---     REMEMBER: You are to check int.libNode.version !    ---*)
  3836. PROCEDURE QueryOverscan  *{int,-474}(displayID{8}     : LONGINT;
  3837.                                      VAR rect{9}      : g.Rectangle;
  3838.                                      oScanType{0}     : LONGINT): LONGINT;
  3839. PROCEDURE MoveWindowInFrontOf*{int,-480}(window{8}    : WindowPtr;
  3840.                                          behindWin{9} : WindowPtr);
  3841. PROCEDURE ChangeWindowBox*{int,-486}(window{8}        : WindowPtr;
  3842.                                      left{0}          : LONGINT;
  3843.                                      top{1}           : LONGINT;
  3844.                                      width{2}         : LONGINT;
  3845.                                      height{3}        : LONGINT);
  3846. PROCEDURE SetEditHook    *{int,-492}(hook{8}          : u.HookPtr): u.HookPtr;
  3847. PROCEDURE SetMouseQueue  *{int,-498}(window{8}        : LONGINT;
  3848.                                      queueLength{0}   : LONGINT): LONGINT;
  3849. PROCEDURE ZipWindow      *{int,-504}(window{8}        : WindowPtr);
  3850. (*--- public screens ---*)
  3851. PROCEDURE LockPubScreen  *{int,-510}(name{8}          : ARRAY OF CHAR): ScreenPtr;
  3852. PROCEDURE UnlockPubScreen*{int,-516}(name{8}          : ARRAY OF CHAR;
  3853.                                      screen{9}        : ScreenPtr);
  3854. PROCEDURE LockPubScreenList*{int,-522}(): e.ListPtr;
  3855. PROCEDURE UnlockPubScreenList*{int,-528}();
  3856. PROCEDURE NextPubScreen  *{int,-534}(screen{8}        : ScreenPtr;
  3857.                                      VAR name{9}      : ARRAY OF CHAR): e.LSTRPTR;
  3858. PROCEDURE SetDefaultPubScreen*{int,-540}(name{8}      : ARRAY OF CHAR);
  3859. PROCEDURE SetPubScreenModes*{int,-546}(modes{0}       : SET): SET;
  3860. PROCEDURE PubScreenStatus*{int,-552}(screen{8}        : ScreenPtr;
  3861.                                      statusFlags{0}   : SET): SET;
  3862. (**)
  3863. PROCEDURE ObtainGIRPort  *{int,-558}(gInfo{8}         : GadgetInfoPtr): g.RastPortPtr;
  3864. PROCEDURE ReleaseGIRPort *{int,-564}(rp{8}            : g.RastPortPtr);
  3865. PROCEDURE GadgetMouse    *{int,-570}(VAR gadget{8}    : Gadget;
  3866.                                      gInfo{9}         : GadgetInfoPtr;
  3867.                                      VAR mousePoint{10} : g.Point);
  3868. (* SetIPrefs is system private and not to be used by applications *)
  3869. PROCEDURE SetIPrefs       {int,-576}(ptr{8}           : e.APTR;
  3870.                                      size{0}          : LONGINT;
  3871.                                      type{1}          : LONGINT);
  3872. PROCEDURE GetDefaultPubScreen*{int,-582}(VAR nameBuffer{8} : ARRAY OF CHAR);
  3873. PROCEDURE EasyRequestArgs*{int,-588}(window{8}        : WindowPtr;
  3874.                                      easyStruct{9}    : EasyStructPtr;
  3875.                                      idcmpPtr{10}     : e.APTR;
  3876.                                      args{11}         : e.APTR): LONGINT;
  3877. PROCEDURE EasyRequest    *{int,-588}(window{8}        : WindowPtr;
  3878.                                      easyStruct{9}    : EasyStructPtr;
  3879.                                      idcmpPtr{10}     : e.APTR;
  3880.                                      arg1{11}..       : e.APTR): LONGINT;
  3881. PROCEDURE BuildEasyRequestArgs*{int,-594}(window{8}   : WindowPtr;
  3882.                                      easyStruct{9}    : EasyStructPtr;
  3883.                                      idcmp{0}         : LONGSET;
  3884.                                      args{11}         : e.APTR): WindowPtr;
  3885. PROCEDURE BuildEasyRequest*{int,-594}(window{8}       : WindowPtr;
  3886.                                      easyStruct{9}    : EasyStructPtr;
  3887.                                      idcmp{0}         : LONGSET;
  3888.                                      arg1{11}..       : e.APTR): WindowPtr;
  3889. PROCEDURE SysReqHandler  *{int,-600}(window{8}        : WindowPtr;
  3890.                                      idcmpPtr{9}      : e.APTR;
  3891.                                      waitInput{0}     : LONGBOOL): LONGINT;
  3892. PROCEDURE OpenWindowTagList*{int,-606}(newWindow{8}   : NewWindow;
  3893.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3894. PROCEDURE OpenWindowTags *{int,-606}(newWindow{8}     : NewWindow;
  3895.                                      tag1{9}..        : u.Tag): WindowPtr;
  3896. PROCEDURE OpenWindowTagListA*{int,-606}(newWindow{8}  : NewWindowPtr;
  3897.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3898. PROCEDURE OpenWindowTagsA *{int,-606}(newWindow{8}    : NewWindowPtr;
  3899.                                      tag1{9}..        : u.Tag): WindowPtr;
  3900. PROCEDURE OpenScreenTagList*{int,-612}(newScreen{8}   : NewScreen;
  3901.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3902. PROCEDURE OpenScreenTags *{int,-612}(newScreen{8}     : NewScreen;
  3903.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3904. PROCEDURE OpenScreenTagListA*{int,-612}(newScreen{8}   : NewScreenPtr;
  3905.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3906. PROCEDURE OpenScreenTagsA *{int,-612}(newScreen{8}     : NewScreenPtr;
  3907.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3908. (**)
  3909. (*      new Image functions *)
  3910. PROCEDURE DrawImageState *{int,-618}(rp{8}            : g.RastPortPtr;
  3911.                                      image{9}         : Image;
  3912.                                      leftOffset{0}    : LONGINT;
  3913.                                      topOffset{1}     : LONGINT;
  3914.                                      state{2}         : LONGINT;
  3915.                                      drawInfo{10}     : DrawInfoPtr);
  3916. PROCEDURE PointInImageL  *{int,-624}(point{0}         : LONGINT;
  3917.                                      image{8}         : Image): BOOLEAN;
  3918.  
  3919. PROCEDURE EraseImage     *{int,-630}(rp{8}            : g.RastPortPtr;
  3920.                                      image{9}         : Image;
  3921.                                      leftOffset{0}    : LONGINT;
  3922.                                      topOffset{1}     : LONGINT);
  3923. (**)
  3924. PROCEDURE NewObjectA     *{int,-636}(class{8}         : IClassPtr;
  3925.                                      classID{9}       : ARRAY OF CHAR;
  3926.                                      tagList{10}      : ARRAY OF u.TagItem): e.APTR;
  3927. PROCEDURE NewObject      *{int,-636}(class{8}         : IClassPtr;
  3928.                                      classID{9}       : ARRAY OF CHAR;
  3929.                                      tag1{10}..       : u.Tag): e.APTR;
  3930. (**)
  3931. PROCEDURE DisposeObject  *{int,-642}(object{8}        : e.APTR);
  3932. PROCEDURE SetAttrsA      *{int,-648}(object{8}        : e.APTR;
  3933.                                      tagList{9}       : ARRAY OF u.TagItem): LONGINT;
  3934. PROCEDURE SetAttrs       *{int,-648}(object{8}        : e.APTR;
  3935.                                      tag1{9}..        : u.Tag): LONGINT;
  3936. (**)
  3937. PROCEDURE GetAttr        *{int,-654}(attrID{0}        : LONGINT;
  3938.                                      object{8}        : e.APTR;
  3939.                                      VAR storage{9}   : ARRAY OF e.BYTE): LONGINT;
  3940. (**)
  3941. (*      special set attribute call for gadgets *)
  3942. PROCEDURE SetGadgetAttrsA*{int,-660}(VAR gadget{8}    : Gadget;
  3943.                                      window{9}        : WindowPtr;
  3944.                                      requester{10}    : RequesterPtr;
  3945.                                      tagList{11}      : ARRAY OF u.TagItem): LONGINT;
  3946. PROCEDURE SetGadgetAttrs *{int,-660}(VAR gadget{8}    : Gadget;
  3947.                                      window{9}        : WindowPtr;
  3948.                                      requester{10}    : RequesterPtr;
  3949.                                      tag1{11}..       : u.Tag): LONGINT;
  3950. (**)
  3951. (*      for class implementors only *)
  3952. PROCEDURE NextObject     *{int,-666}(VAR objectPtr{8} : ObjectPtr): e.APTR;
  3953. PROCEDURE FindClass      *{int,-672}(classID{8}       : ARRAY OF CHAR): IClassPtr;
  3954. PROCEDURE MakeClass      *{int,-678}(classID{8}       : ARRAY OF CHAR;
  3955.                                      superClassID{9}  : ARRAY OF CHAR;
  3956.                                      superClassPtr{10}: IClassPtr;
  3957.                                      instanceSize{0}  : LONGINT;
  3958.                                      flags{1}         : LONGSET): IClassPtr;
  3959. PROCEDURE AddClass       *{int,-684}(class{8}         : IClassPtr);
  3960. (**)
  3961. (**)
  3962. PROCEDURE GetScreenDrawInfo*{int,-690}(screen{8}      : ScreenPtr): DrawInfoPtr;
  3963. PROCEDURE FreeScreenDrawInfo*{int,-696}(screen{8}     : ScreenPtr;
  3964.                                      drawInfo{9}      : DrawInfoPtr);
  3965. (**)
  3966. PROCEDURE ResetMenuStrip *{int,-702}(window{8}        : WindowPtr;
  3967.                                      VAR menu{9}      : Menu): BOOLEAN;
  3968. PROCEDURE RemoveClass    *{int,-708}(classPtr{8}      : IClassPtr);
  3969. PROCEDURE FreeClass      *{int,-714}(classPtr{8}      : IClassPtr): BOOLEAN;
  3970.  
  3971. (*--- functions in V39 or higher (Release 3) ---*)
  3972. PROCEDURE AllocScreenBuffer *{int,-0300H}(sc{8}       : ScreenPtr;
  3973.                                           bm{9}       : g.BitMapPtr;
  3974.                                           flags{0}    : LONGSET): ScreenBufferPtr;
  3975. PROCEDURE FreeScreenBuffer  *{int,-0306H}(sc{8}       : ScreenPtr;
  3976.                                           sb{9}       : ScreenBufferPtr);
  3977. PROCEDURE ChangeScreenBuffer*{int,-030CH}(sc{8}       : ScreenPtr;
  3978.                                           sb{9}       : ScreenBufferPtr): BOOLEAN;
  3979. PROCEDURE ScreenDepth       *{int,-0312H}(screen{8}   : ScreenPtr;
  3980.                                           flags{0}    : LONGSET;
  3981.                                           reserved{9} : e.APTR);
  3982. PROCEDURE ScreenPosition    *{int,-0318H}(screen{8}   : ScreenPtr;
  3983.                                           flags{0}    : LONGSET;
  3984.                                           x1{1}       : LONGINT;
  3985.                                           y1{2}       : LONGINT;
  3986.                                           x2{3}       : LONGINT;
  3987.                                           y2{4}       : LONGINT);
  3988. PROCEDURE ScrollWindowRaster *{int,-031EH}(win{9}     : WindowPtr;
  3989.                                           dx{0}       : LONGINT;
  3990.                                           dy{1}       : LONGINT;
  3991.                                           xMin{2}     : LONGINT;
  3992.                                           yMin{3}     : LONGINT;
  3993.                                           xMax{4}     : LONGINT;
  3994.                                           yMax{5}     : LONGINT);
  3995. PROCEDURE LendMenus         *{int,-0324H}(fromWin{8}  : WindowPtr;
  3996.                                           toWindow{9} : WindowPtr);
  3997. PROCEDURE DoGadgetMethodA   *{int,-032AH}(gad{8}      : GadgetPtr;
  3998.                                           win{9}      : WindowPtr;
  3999.                                           eq{10}      : RequesterPtr;
  4000.                                           message{11} : Msg): LONGINT;
  4001. PROCEDURE DoGadgetMethod    *{int,-032AH}(gad{8}      : GadgetPtr;
  4002.                                           win{9}      : WindowPtr;
  4003.                                           req{10}     : RequesterPtr;
  4004.                                           MethodID{11}..: e.ADDRESS): LONGINT;
  4005. PROCEDURE SetWindowPointerA *{int,-0330H}(win{8}      : WindowPtr;
  4006.                                           taglist{9}  : ARRAY OF u.TagItem);
  4007. PROCEDURE SetWindowPointer  *{int,-0330H}(win{8}      : WindowPtr;
  4008.                                           tag1{9}..   : u.Tag);
  4009. PROCEDURE TimedDisplayAlert *{int,-0336H}(alertNum{0} : LONGINT;
  4010.                                           string{8}   : ARRAY OF CHAR;
  4011.                                           height{1}   : LONGINT;
  4012.                                           time{9}     : LONGINT): BOOLEAN;
  4013. PROCEDURE HelpControl       *{int,-033CH}(win{8}      : WindowPtr;
  4014.                                           flags{0}    : LONGSET);
  4015.  
  4016. (*=========================================================================*)
  4017.  
  4018. PROCEDURE PointInImage * (point: g.Point; image: Image): BOOLEAN;
  4019. BEGIN RETURN PointInImageL(y.VAL(LONGINT,point),image); END PointInImage;
  4020.  
  4021. (* === MACROS ============================================================ *)
  4022.  
  4023. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  4024.  
  4025. PROCEDURE MenuNum * (n{0}: INTEGER): INTEGER;
  4026. BEGIN RETURN y.VAL(INTEGER,      y.VAL(SET,n)      * {0..4}) END MenuNum;
  4027.  
  4028. PROCEDURE ItemNum * (n{0}: INTEGER): INTEGER;
  4029. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n),- 5) * {0..5}) END ItemNum;
  4030.  
  4031. PROCEDURE SubNum  * (n{0}: INTEGER): INTEGER;
  4032. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n),-11) * {0..4}) END SubNum;
  4033.  
  4034.  
  4035. PROCEDURE ShiftMenu * (n{0}: INTEGER): INTEGER;
  4036. BEGIN RETURN y.VAL(INTEGER,      y.VAL(SET,n) * {0..4}    ) END ShiftMenu;
  4037.  
  4038. PROCEDURE ShiftItem * (n{0}: INTEGER): INTEGER;
  4039. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n) * {0..5}, 5)) END ShiftItem;
  4040.  
  4041. PROCEDURE ShiftSub  * (n{0}: INTEGER): INTEGER;
  4042. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n) * {0..4},11)) END ShiftSub;
  4043.  
  4044. PROCEDURE FullMenuNum * (menu, item, sub: INTEGER): INTEGER;
  4045. BEGIN RETURN ShiftMenu(menu) + ShiftItem(item) + ShiftSub(sub) END FullMenuNum;
  4046.  
  4047.  
  4048. (* Preferences.ser...: *)
  4049.  
  4050. PROCEDURE SRBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 8 - ORD(n) DIV 16 END SRBNum;
  4051. PROCEDURE SWBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 8 - ORD(n) MOD 16 END SWBNum;
  4052. PROCEDURE SSBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 1 + ORD(n) DIV 16 END SSBNum;
  4053. PROCEDURE SPARNum * (n{0}: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) DIV 16 END SPARNum;
  4054. PROCEDURE SHAKNum * (n{0}: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) MOD 16 END SHAKNum;
  4055.  
  4056.  
  4057. (* this casts MutualExclude for easy assignment of a hook
  4058.  * pointer to the unused MutualExclude field of a custom gadget
  4059.  *)
  4060. PROCEDURE CustomHook * (VAR g{8}: Gadget): u.HookPtr;
  4061. BEGIN RETURN y.VAL(u.HookPtr,g.mutualExclude) END CustomHook;
  4062.  
  4063.  
  4064. (* some convenient macros and casts *)
  4065. PROCEDURE GadgetBox * (VAR g{8}: Gadget): IBoxPtr;  BEGIN RETURN y.ADR(g.leftEdge) END GadgetBox;
  4066. PROCEDURE IMBox     * (VAR i{8}: Image ): IBoxPtr;  BEGIN RETURN y.ADR(i.leftEdge) END IMBox;
  4067. PROCEDURE FGPen     * (VAR i{8}: Image ): SHORTINT; BEGIN RETURN y.VAL(SHORTINT,i.planePick ) END FGPen;
  4068. PROCEDURE BGPen     * (VAR i{8}: Image ): SHORTINT; BEGIN RETURN y.VAL(SHORTINT,i.planeOnOff) END BGPen;
  4069.  
  4070. (*------  Special:  ------*)
  4071.  
  4072. (* convert BOOLEANs to LONGBOOLs: *)
  4073.  
  4074. PROCEDURE BoolToLong*(b{0}: BOOLEAN): LONGBOOL;
  4075. BEGIN IF b THEN RETURN LTRUE ELSE RETURN LFALSE END
  4076. END BoolToLong;
  4077.  
  4078. (* Convert pseudo unsigned integers (like those within PropInfo) to
  4079.  * LONGINTs and vice versa:
  4080.  *)
  4081.  
  4082. PROCEDURE UIntToLong*(i{0}: INTEGER): LONGINT;
  4083. BEGIN
  4084.   IF i<0 THEN RETURN i+10000H
  4085.          ELSE RETURN i        END;
  4086. END UIntToLong;
  4087.  
  4088.  
  4089. PROCEDURE LongToUInt*(l{0}: LONGINT): INTEGER;
  4090. BEGIN
  4091. (* $RangeChk- Tricky: just return lower Word *)
  4092.   RETURN SHORT(l)
  4093. (* $RangeChk= *)
  4094. END LongToUInt;
  4095.  
  4096.  
  4097. (*-----------------------------------------------------------------------*)
  4098. (*
  4099.  * The following procedures are implemented for to avoid using SYSTEM within
  4100.  * Oberon programs.
  4101.  *)
  4102.  
  4103. PROCEDURE ScreenToRastPort*(s{8}: ScreenPtr): g.RastPortPtr;
  4104. BEGIN RETURN y.ADR(s.rastPort); END ScreenToRastPort;
  4105.  
  4106. PROCEDURE ScreenToViewPort*(s{8}: ScreenPtr): g.ViewPortPtr;
  4107. BEGIN RETURN y.ADR(s.viewPort); END ScreenToViewPort;
  4108.  
  4109. (*-----------------------------------------------------------------------*)
  4110.  
  4111. BEGIN
  4112.   int :=  e.OpenLibrary(intuitionName,33);
  4113.   IF int = NIL THEN HALT(20) END;
  4114.   base := int;
  4115.  
  4116. CLOSE
  4117.   IF int#NIL THEN e.CloseLibrary(int) END;
  4118.  
  4119. END Intuition.
  4120.